Part Number Hot Search : 
17E5CM JA3505A DL4148 BC171A A2717 HI1178 DC100 CY28323
Product Description
Full Text Search
 

To Download E702360SH7058 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 To all our customers
Regarding the change of names mentioned in the document, such as Hitachi Electric and Hitachi XX, to Renesas Technology Corp.
The semiconductor operations of Mitsubishi Electric and Hitachi were transferred to Renesas Technology Corporation on April 1st 2003. These operations include microcomputer, logic, analog and discrete devices, and memory chips other than DRAMs (flash memory, SRAMs etc.) Accordingly, although Hitachi, Hitachi, Ltd., Hitachi Semiconductors, and other Hitachi brand names are mentioned in the document, these names have in fact all been changed to Renesas Technology Corp. Thank you for your understanding. Except for our corporate trademark, logo and corporate statement, no changes whatsoever have been made to the contents of the document, and these changes do not constitute any alteration to the contents of the document itself. Renesas Technology Home Page: http://www.renesas.com
Renesas Technology Corp. Customer Support Dept. April 1, 2003
Cautions
Keep safety first in your circuit designs! 1. Renesas Technology Corporation puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. Trouble with semiconductors may lead to personal injury, fire or property damage. Remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. Notes regarding these materials 1. These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corporation product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to Renesas Technology Corporation or a third party. 2. Renesas Technology Corporation assumes no responsibility for any damage, or infringement of any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials. 3. All information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by Renesas Technology Corporation without notice due to product improvements or other reasons. It is therefore recommended that customers contact Renesas Technology Corporation or an authorized Renesas Technology Corporation product distributor for the latest product information before purchasing a product listed herein. The information described here may contain technical inaccuracies or typographical errors. Renesas Technology Corporation assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. Please also pay attention to information published by Renesas Technology Corporation by various means, including the Renesas Technology Corporation Semiconductor home page (http://www.renesas.com). 4. When using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. Renesas Technology Corporation assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. 5. Renesas Technology Corporation semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. Please contact Renesas Technology Corporation or an authorized Renesas Technology Corporation product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. 6. The prior written approval of Renesas Technology Corporation is necessary to reprint or reproduce in whole or in part these materials. 7. If these products or technologies are subject to the Japanese export control restrictions, they must be exported under a license from the Japanese government and cannot be imported into a country other than the approved destination. Any diversion or reexport contrary to the export control laws and regulations of Japan and/or the country of destination is prohibited. 8. Please contact Renesas Technology Corporation for further details on these materials or the products contained therein.
SH7058 E6000H Emulator HS7058EPH60H
User's Manual
ADE-702-360A Rev. 2.0 10/28/02 Hitachi, Ltd.
HS7058EPH60HE
Cautions
1. Hitachi neither warrants nor grants licenses of any rights of Hitachi's or any third party's patent, copyright, trademark, or other intellectual property rights for information contained in this document. Hitachi bears no responsibility for problems that may arise with third party's rights, including intellectual property rights, in connection with use of the information contained in this document. 2. Products and product specifications may be subject to change without notice. Confirm that you have received the latest product standards or specifications before final design, purchase or use. 3. Hitachi makes every attempt to ensure that its products are of high quality and reliability. However, contact Hitachi's sales office before using the product in an application that demands especially high quality and reliability or where its failure or malfunction may directly threaten human life or cause risk of bodily injury, such as aerospace, aeronautics, nuclear power, combustion control, transportation, traffic, safety equipment or medical equipment for life support. 4. Design your application so that the product is used within the ranges guaranteed by Hitachi particularly for maximum rating, operating supply voltage range, heat radiation characteristics, installation conditions and other characteristics. Hitachi bears no responsibility for failure or damage when used beyond the guaranteed ranges. Even within the guaranteed ranges, consider normally foreseeable failure rates or failure modes in semiconductor devices and employ systemic measures such as fail-safes, so that the equipment incorporating Hitachi product does not cause bodily injury, fire or other consequential damage due to operation of the Hitachi product. 5. This product is not designed to be radiation resistant. 6. No one is permitted to reproduce or duplicate, in any form, the whole or part of this document without written approval from Hitachi. 7. Contact Hitachi's sales office for any questions regarding this document or Hitachi semiconductor products.
v
IMPORTANT INFORMATION
READ FIRST
* READ this user's manual before using this emulator product. * KEEP the user's manual handy for future reference. Do not attempt to use the emulator product until you fully understand its mechanism. Emulator Product: Throughout this document, the term "emulator product" shall be defined as the following products produced only by Hitachi, Ltd. excluding all subsidiary products. * * * * Emulator station PC interface board User system interface board Cable
The user system or a host computer is not included in this definition. Purpose of the Emulator Product: This emulator product is a software and hardware development tool for systems employing the Hitachi microcomputer HD64F7058 (hereafter referred to as MCU). This emulator product must only be used for the above purpose. Limited Applications: This emulator product is not authorized for use in MEDICAL, atomic energy, aeronautical or space technology applications without consent of the appropriate officer of a Hitachi sales company. Such use includes, but is not limited to, use in life support systems. Buyers of this emulator product must notify the relevant Hitachi sales offices before planning to use the product in such applications. Improvement Policy: Hitachi, Ltd. (including its subsidiaries, hereafter collectively referred to as Hitachi) pursues a policy of continuing improvement in design, performance, and safety of the emulator product. Hitachi may change, wholly or partially, the specifications, design, user's manual, and other documentation at any time without notice. Target User of the Emulator Product: This emulator product should only be used by those who have carefully read and thoroughly understood the information and restrictions contained in the user's manual. Do not attempt to use the emulator product until you fully understand its mechanism. It is highly recommended that first-time users be instructed by users that are well versed in the operation of the emulator product.
I
LIMITED WARRANTY
Hitachi warrants its emulator products to be manufactured in accordance with published specifications and free from defects in material and/or workmanship. Hitachi, at its option, will repair or replace any emulator products returned intact to the factory, transportation charges prepaid, which Hitachi, upon inspection, determine to be defective in material and/or workmanship. The foregoing shall constitute the sole remedy for any breach of Hitachi's warranty. See the Hitachi warranty booklet for details on the warranty period. This warranty extends only to you, the original Purchaser. It is not transferable to anyone who subsequently purchases the emulator product from you. Hitachi is not liable for any claim made by a third party or made by you for a third party.
DISCLAIMER
HITACHI MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, ORAL OR WRITTEN, EXCEPT AS PROVIDED HEREIN, INCLUDING WITHOUT LIMITATION THEREOF, WARRANTIES AS TO MARKETABILITY, MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE OR USE, OR AGAINST INFRINGEMENT OF ANY PATENT. IN NO EVENT SHALL HITACHI BE LIABLE FOR ANY DIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY NATURE, OR LOSSES OR EXPENSES RESULTING FROM ANY DEFECTIVE EMULATOR PRODUCT, THE USE OF ANY EMULATOR PRODUCT, OR ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. EXCEPT AS EXPRESSLY STATED OTHERWISE IN THIS WARRANTY, THIS EMULATOR PRODUCT IS SOLD "AS IS ", AND YOU MUST ASSUME ALL RISK FOR THE USE AND RESULTS OBTAINED FROM THE EMULATOR PRODUCT.
II
State Law: Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may have other rights which may vary from state to state. The Warranty is Void in the Following Cases: Hitachi shall have no liability or legal responsibility for any problems caused by misuse, abuse, misapplication, neglect, improper handling, installation, repair or modifications of the emulator product without Hitachi's prior written consent or any problems caused by the user system. All Rights Reserved: This user's manual and emulator product are copyrighted and all rights are reserved by Hitachi. No part of this user's manual, all or part, may be reproduced or duplicated in any form, in hardcopy or machine-readable form, by any means available without Hitachi's prior written consent. Other Important Things to Keep in Mind: 1. Circuitry and other examples described herein are meant merely to indicate the characteristics and performance of Hitachi's semiconductor products. Hitachi assumes no responsibility for any intellectual property claims or other problems that may result from applications based on the examples described herein. 2. No license is granted by implication or otherwise under any patents or other rights of any third party or Hitachi. Figures: Some figures in this user's manual may show items different from your actual system. Limited Anticipation of Danger: Hitachi cannot anticipate every possible circumstance that might involve a potential hazard. The warnings in this user's manual and on the emulator product are therefore not all inclusive. Therefore, you must use the emulator product safely at your own risk.
III
SAFETY PAGE
READ FIRST
* READ this user's manual before using this emulator product. * KEEP the user's manual handy for future reference. Do not attempt to use the emulator product until you fully understand its mechanism.
DEFINITION OF SIGNAL WORDS
This is the safety alert symbol. It is used to alert you to potential personal injury hazards. Obey all safety messages that follow this symbol to avoid possible injury or death.
DANGER
DANGER indicates an imminently hazardous situation which, if not avoided, will result in death or serious injury.
WARNING indicates a potentially hazardous situation which, if not avoided, could result in death or serious injury.
CAUTION indicates a potentially hazardous situation which, if not avoided, may result in minor or moderate injury.
WARNING
CAUTION
CAUTION
CAUTION used without the safety alert symbol indicates a potentially hazardous situation which, if not avoided, may result in property damage.
NOTE emphasizes essential information.
IV
WARNING
Observe the precautions listed below. Failure to do so will result in a FIRE HAZARD and will damage the user system and the emulator product or will result in PERSONAL INJURY. The USER PROGRAM will be LOST. 1. Carefully handle the emulator product to prevent receiving an electric shock because the emulator product has a DC power supply. Do not repair or remodel the emulator product by yourself for electric shock prevention and quality assurance. 2. Always switch OFF the emulator and user system before connecting or disconnecting any CABLES or PARTS. 3. Always before connecting, make sure that pin 1 on both sides are correctly aligned. 4. Supply power according to the power specifications and do not apply an incorrect power voltage. Use only the provided AC power cable. Use only the specified type of fuse.
V
Warnings on Emulator Usage
Warnings described below apply as long as you use this emulator. Be sure to read and understand the warnings below before using this emulator. Note that these are the main warnings, not the complete list.
WARNING
Always switch OFF the emulator and user system before connecting or disconnecting any CABLES or PARTS. Failure to do so will result in a FIRE HAZARD and will damage the user system and the emulator product or will result in PERSONAL INJURY. The USER PROGRAM will be LOST.
VI
CAUTION
Place the emulator station and evaluation chip board so that the trace cables are not bent or twisted. A bent or twisted cable will impose stress on the user interface leading to connection or contact failure. Make sure that the emulator station is placed in a secure position so that it does not move during use nor impose stress on the user interface.
E6000H
HITACHI
OK
E6000H
HITACHI
E6000H
HITAC HI
NG
NG
VII
CAUTION
This equipment has been tested and found to comply with the limits for a Class A digital device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference when the equipment is operated in a commercial environment. This equipment generates, uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instruction manual, may cause harmful interference to radio communications. Operation of this equipment in a residential area is likely to cause harmful interference in which case the user will be required to correct the interference at his own expense.
VIII
Preface
Thank you for purchasing the emulator for the Hitachi microcomputer SH7058.
CAUTION
Read section 3, Preparation before Use before using the emulator product. Incorrect operation or connection will damage the user system, the emulator product, and the user program.
The SH7058 E6000H emulator (hereinafter referred to as the emulator) is an efficient software and hardware development tool for systems based on Hitachi microcomputer SH7058. The emulator is operated by using the Hitachi Debugging Interface (hereafter referred to as HDI). This interface program is supported by Windows(R) 98, Windows(R) Me, Windows NT(R) 4.0, and Windows(R) 2000. This manual describes the emulator functions and operations. Please read this manual carefully before use, in particular section 1.1, Notes on Usage. A CD-R for the E6000H emulator is packaged with the emulator. For details, refer to section 3, Preparation before Use. Related Manuals: Description Notes on Using the PC Card Interface (HS6000EIP01H) for the E6000/E8000 Emulator Description Notes on Using the PCI Interface Board (HS6000EIC01H) for the E6000/E8000 Emulator Description Notes on Using the PCI Interface Board (HS6000EIC02H) for the E6000/E8000 Emulator Description Notes on Using the LAN Adapter (HS6000ELN01H) for the E6000/E8000 Emulator Description Notes on Using the USB Adapter (HS6000EIU01H) for the E6000/E8000 Emulator Hitachi Embedded Workshop User's Manual SuperHTM RISC engine C/C++ Compiler User's Manual SuperHTM RISC engine Assembler User's Manual H Series Linkage Editor, Librarian, Object Converter User's Manual Hitachi Debugging Interface User's Manual Hardware Manual supporting each MCU Programming Manual supporting each MCU
i
Notes: 1. IBM PC is a registered trademark of International Business Machines Corporation. 2. Microsoft(R), Windows(R), and Windows NT(R) 4.0 are registered trademarks of Microsoft Corporation in the United States and/or in other countries. 3. Pentium(R) is a registered trademark of Intel Corporation in the United States. Abbreviation: 1.Windows(R) 98 is an abbreviation for Microsoft(R) Windows(R) 98 operating system. 2.Windows(R) Me is an abbreviation for Microsoft(R) Windows(R) Millennium Edition. 3.Windows NT(R) 4.0 is an abbreviation for Microsoft(R) Windows NT(R) 4.0 operating system. 4.Windows(R) 2000 is an abbreviation for Microsoft(R) Windows(R) 2000 operating system.
ii
Contents
Section 1
1.1 1.2 1.3
Overview..........................................................................................1
Notes on Usage ................................................................................................................. 4 Environmental Conditions................................................................................................. 5 Components ...................................................................................................................... 7 1.3.1 Emulator............................................................................................................... 7 1.3.2 Options................................................................................................................. 8
Section 2 Components.........................................................................................9
2.1 Emulator Hardware Components ...................................................................................... 9 2.1.1 E6000H Station Components............................................................................... 10 2.1.2 Evaluation Chip Board Configuration.................................................................. 12 2.1.3 Configuration of User System Interface Board .................................................... 14 Configuration of the Provided CD-R ................................................................................ 15 System Configuration........................................................................................................18 2.3.1 System Configuration Using a PC Interface Board .............................................. 18
2.2 2.3
Section 3 Preparation before Use ........................................................................21
3.1 3.2 3.3 Description on Emulator Usage ........................................................................................ 21 Installing the Acrobat(R) Reader.......................................................................................... 22 Emulator Connection......................................................................................................... 22 3.3.1 Connecting the User System ................................................................................ 22 3.3.2 Connecting the User System Interface Board....................................................... 23 3.3.3 Connecting the External Probe............................................................................. 24 3.3.4 Selecting the Clock .............................................................................................. 25 3.3.5 Connecting the System Ground............................................................................ 27 3.3.6 PC Interface Board Specifications (PCI Bus Specifications)............................... 29
Section 4 Tutorial ................................................................................................33
4.1 4.2 4.3 4.4 Introduction....................................................................................................................... 33 Running the HDI ............................................................................................................... 34 Setting the Memory Map................................................................................................... 37 Downloading ..................................................................................................................... 39 4.4.1 Downloading the Sample Program....................................................................... 39 4.4.2 Displaying the Source Program............................................................................ 40 Setting the Program Counter Breakpoints ......................................................................... 42 Executing the Program ...................................................................................................... 43
4.5 4.6
iii
4.7 4.8 4.9 4.10
Reviewing Breakpoints ..................................................................................................... 45 Viewing Memory .............................................................................................................. 46 Watching Variables........................................................................................................... 48 Stepping Through a Program ............................................................................................ 51 4.10.1 Executing [Step In] Command ............................................................................. 53 4.10.2 Executing [Step Out] Command .......................................................................... 54 4.10.3 Executing [Step Over] Command ........................................................................ 57 4.11 Displaying Local Variables ............................................................................................... 59 4.12 Saving and Loading the Session........................................................................................ 60
Section 5 Emulator Functions.............................................................................61
5.1 5.2 Introduction....................................................................................................................... 61 Setting the Emulator's Operating Conditions.................................................................... 62 5.2.1 [Configuration] Dialog Box ................................................................................. 63 5.3 Program Execution............................................................................................................ 80 5.3.1 Execution ............................................................................................................. 80 5.4 Display of Cause for Termination and Operating Status ................................................... 81 5.5 Step Functions................................................................................................................... 83 5.5.1 Step Execution ..................................................................................................... 83 5.5.2 Accepting Interrupts during Step Execution ........................................................ 83 5.6 Break Functions ................................................................................................................ 84 5.6.1 On-Chip Break ..................................................................................................... 86 5.6.2 On-Chip Sequential Break ................................................................................... 97 5.6.3 On-Emulator Break .............................................................................................. 101 5.6.4 Software Break..................................................................................................... 113 5.6.5 Forced Break........................................................................................................ 116 5.6.6 Break Due to Trace-Buffer Overflow .................................................................. 117 5.7 Realtime Trace Functions.................................................................................................. 118 5.7.1 Trace Acquisition Condition ................................................................................ 118 5.7.2 External Bus Trace Timing .................................................................................. 136 5.7.3 Trace Display....................................................................................................... 137 5.7.4 Trace Search Functions........................................................................................ 140 5.7.5 Trace Find Functions ........................................................................................... 150 5.8 Measurement of Execution Time ...................................................................................... 151 5.8.1 Measuring Normal Execution Time ..................................................................... 151 5.8.2 Measuring Execution Time between Satisfaction of Specified Conditions.......... 152 5.9 Performance Analysis Function......................................................................................... 155 5.9.1 Measuring with E6000H Station Function ........................................................... 155 5.9.2 Profiling Function ................................................................................................ 168 5.10 Displaying Various Information........................................................................................ 173
iv
5.11 Trigger Output................................................................................................................... 176 5.12 Stack Trace Function......................................................................................................... 177 5.13 Displaying and Updating the Contents of Memory ........................................................... 179 5.13.1 Displaying and Updating the Contents of Memory during Execution.................. 179 5.13.2 Overview of Auto-Update Memory Function ...................................................... 180 5.13.3 Setting Auto update Memory ............................................................................... 181 5.13.4 Displaying the Auto update Memory ................................................................... 181 5.14 Input Format...................................................................................................................... 183 5.14.1 Entering Masks .................................................................................................... 183 5.15 [Source] Window Expanded Function .............................................................................. 184 5.15.1 Setting BP Column............................................................................................... 184
Section 6 Command Line....................................................................................185
6.1 List Format........................................................................................................................ 185 6.1.1 Description........................................................................................................... 185 6.1.2 Format.................................................................................................................. 185 6.1.3 Parameter Type Input........................................................................................... 186 6.1.4 Examples.............................................................................................................. 186 List of Commands ............................................................................................................. 187 6.2.1 ANALYSIS (AN)................................................................................................. 191 6.2.2 ANALYSIS RANGEn (ARn) .............................................................................. 192 6.2.3 ANALYSIS_RANGE_DELETEn (ADn) ............................................................ 197 6.2.4 On-Chip Break Commands (BC, BCn, BCC, BCE, BCR) .................................. 198 6.2.5 On-Emulator Break Commands (BE, BEn, BEC, BEE) ...................................... 204 6.2.6 Software Break Commands (BS, BSC, BSE) ...................................................... 210 6.2.7 CLOCK (CK)....................................................................................................... 211 6.2.8 CONFIGURATION_PLATFORM (CP) ............................................................. 212 6.2.9 DEVICE_TYPE (DE).......................................................................................... 214 6.2.10 ERAM (EM) ........................................................................................................ 215 6.2.11 FLASH_MEMORY (FM).................................................................................... 217 6.2.12 MAP_DISPLAY (MA) ........................................................................................ 218 6.2.13 MODE (MO)........................................................................................................ 219 6.2.14 REFRESH (RF) ................................................................................................... 220 6.2.15 TEST_EMULATOR (TE) ................................................................................... 221 6.2.16 TIMER (TI) ......................................................................................................... 222 6.2.17 TRACE_ACQUISITION (TA, TAn)................................................................... 223 6.2.18 TRACE_ALL (TL) .............................................................................................. 230 6.2.19 TRACE_COMPARE (TC) .................................................................................. 232 6.2.20 TRACE_SAVE (TV) ........................................................................................... 233 6.2.21 TRACE_SEARCH (TS) ...................................................................................... 234
v
6.2
6.2.22 USER_SIGNALS (US)........................................................................................ 239
Section 7 Error Messages....................................................................................241
7.1 Error Messages of the Emulator........................................................................................ 241 7.1.1 Error messages at Emulator Initiation .................................................................. 241 7.1.2 Error messages during Emulation ........................................................................ 242 HDI Error Messages Related to the Emulator................................................................... 243 Error Messages for the LAN Driver.................................................................................. 243
7.2 7.3
Appendix A User System Interface Circuit .......................................................245
A.1 User System Interface Circuit ........................................................................................... 245
Appendix B Emulator External Dimensions and Mass .....................................253 Appendix C Connecting the Emulator to the User System ...............................255
C.1 Connecting to the User System ......................................................................................... 255 C.1.1 Installing IC Socket.............................................................................................. 256 C.1.2 Connection Using the HS7058ECF61H............................................................... 256 C.1.3 Connection Using the Dedicated Connector ........................................................ 260 Pin Arrangement on the User System Interface Connector ............................................... 263 Precautions on Connecting the User System ..................................................................... 271
C.2 C.3
Appendix D MCU Internal Module Support .....................................................273
D.1 Memory Space .................................................................................................................. 273 D.1.1 Internal Flash Memory Area ................................................................................ 273 D.1.2 Internal I/O Area .................................................................................................. 273 D.1.3 External Memory Area......................................................................................... 273 D.1.4 Emulation RAM Area .......................................................................................... 273 Low Power-consumption Mode (Sleep, Software Standby, and Hardware Standby) ..... 274 D.2.1 Hardware Standby Mode...................................................................................... 274 D.2.2 Sleep and Software Standby Modes..................................................................... 274 Interrupts ........................................................................................................................... 274 Control Input Signals (_RES, _BREQ, and _WAIT)........................................................ 275 Watchdog Timer (WDT)................................................................................................... 275 A/D Converter................................................................................................................... 275 Emulator Status and Internal Modules .............................................................................. 276
D.2
D.3 D.4 D.5 D.6 D.7
Appendix E Notes on Debugging ......................................................................277
E.1 Notes on HDI .................................................................................................................... 277 E.1.1 Memory Compare Function ................................................................................. 277
vi
E.2 E.3 E.4 E.5 E.6 E.7
E.1.2 Source-Level Execution ....................................................................................... 277 E.1.3 Watch ................................................................................................................... 277 E.1.4 Symbol Description for Expression ..................................................................... 278 E.1.5 Register Function ................................................................................................. 278 E.1.6 Session File Function ........................................................................................... 278 E.1.7 Command Line Window ...................................................................................... 278 E.1.8 [I/O Registers] Window ....................................................................................... 279 E.1.9 Bit Field ............................................................................................................... 279 E.1.10 Line Assembly ..................................................................................................... 279 E.1.11 Usage with Another HDI...................................................................................... 280 E.1.12 Operation During Accessing Files ....................................................................... 280 E.1.13 Moving Source File Position after Creating Load Module .................................. 280 User System Interface .......................................................................................................280 On-Emulator Break Functions........................................................................................... 281 E.3.1 Setting Address Bus and Data Bus Conditions .................................................... 281 Sequential Trace Function................................................................................................. 282 Differences between the Emulator and the MCU.............................................................. 282 Step Function .................................................................................................................... 283 Displaying and Modifying the Contents of Memory ......................................................... 283 E.7.1 Suspension of Program Execution: Reference Periods ........................................ 283 E.7.2 Parallel Access ..................................................................................................... 283 E.7.3 External Memory Area Access in Single-Chip Mode .......................................... 283
Appendix F Diagnostic Test Procedure .............................................................285
F.1 F.2 F.3 System Set-Up for Diagnostic Program Execution ........................................................... 285 Test Item of the Diagnostic Program................................................................................. 287 Diagnostic Test Procedure Using the Diagnostic Program ............................................... 288
vii
Figures Figure 1.1 Configuration of the Emulator for the SH7058 ........................................................ 2 Figure 2.1 Emulator Hardware Components.............................................................................. 9 Figure 2.2 E6000H Station: Front Panel.................................................................................... 10 Figure 2.3 E6000H Station: Rear Panel ..................................................................................... 11 Figure 2.4 Evaluation Chip Board (HS7058EPH60H) .............................................................. 12 Figure 2.5 Configuration of User System Interface Board......................................................... 14 Figure 2.6 System Configuration Using a PC Interface Board .................................................. 18 Figure 2.7 System Configuration Using a LAN Adapter ........................................................... 19 Figure 2.8 System Configuration Using a USB Adapter............................................................ 19 Figure 3.1 Emulator Preparation Flowchart............................................................................... 21 Figure 3.2 Connecting the User System Interface Board ........................................................... 23 Figure 3.3 External Probe Connector......................................................................................... 2 4 Figure 3.4 Installing the Crystal Oscillator ................................................................................ 26 Figure 3.5 Connecting the System Ground ................................................................................ 27 Figure 3.6 Connecting the Frame Ground.................................................................................. 28 Figure 3.7 Installing the PCI Interface Board ............................................................................ 30 Figure 3.8 Connecting the E6000H Station to the PC Interface Board...................................... 31 Figure 4.1 [Start] Menu ...................................................................................................... ....... 34 Figure 4.2 HDI Window ............................................................................................................ 36 Figure 4.3 [ERam] Page (before Setting)................................................................................... 37 Figure 4.4 Allocating the Emulation Memory ........................................................................... 38 Figure 4.5 [Load Program] Dialog Box ..................................................................................... 39 Figure 4.6 [HDI] Dialog Box..................................................................................................... 39 Figure 4.7 [Open] Dialog Box ................................................................................................... 40 Figure 4.8 [Source] Window (Displaying the Source Program) ................................................ 41 Figure 4.9 [Source] Window (Setting a PC Breakpoint)............................................................ 42 Figure 4.10 [Source] Window (Break State).............................................................................. 43 Figure 4.11 [System Status] Window ........................................................................................ 44 Figure 4.12 [Breakpoints] Window ........................................................................................... 45 Figure 4.13 [Open Memory Window] Dialog Box .................................................................... 46 Figure 4.14 [Long Memory] Window........................................................................................ 47 Figure 4.15 [Instant Watch] Dialog Box.................................................................................... 48 Figure 4.16 [Watch Window] Window (Displaying the Array)................................................. 49 Figure 4.17 [Add Watch] Dialog Box........................................................................................ 49 Figure 4.18 [Watch Window] Window (Displaying the Variable) ............................................ 50 Figure 4.19 [Watch Window] Window (Displaying Array Elements) ....................................... 50 Figure 4.20 [Source] Window (Step Execution)........................................................................ 52 Figure 4.21 [Source] Window (Step In)..................................................................................... 53
viii
Figure 4.22 [Source] Window (Step Out) .................................................................................. 54 Figure 4.23 [Watch Window] Display Example (1) .................................................................. 55 Figure 4.24 [Source] Window (Step Out Step In)................................................................. 55 Figure 4.25 [Watch Window] Display Example (2) .................................................................. 56 Figure 4.26 [Source] Window (Before Step Over Execution) ................................................... 57 Figure 4.27 [Source] Window (After Step Over Execution)...................................................... 58 Figure 4.28 [Watch Window] Display Example (3) .................................................................. 58 Figure 4.29 [Locals] Window .................................................................................................... 59 Figure 4.30 [Locals] Window (Displaying Array a Elements) .................................................. 59 Figure 5.1 [Configuration] Dialog Box...................................................................................... 63 Figure 5.2 [Configuration] Dialog Box ([General] Page) .......................................................... 65 Figure 5.3 [Configuration] Dialog Box ([ERam] Page)............................................................. 68 Figure 5.4 [User] Mode in [ERam] Page ................................................................................... 70 Figure 5.5 Diagram for Emulation Memory in [User] Mode ..................................................... 71 Figure 5.6 Allocation to ERAM0 and ERAM1 Display ............................................................ 72 Figure 5.7 Diagram for Allocation to ERAM0 and ERAM1 .................................................... 73 Figure 5.8 Allocation to ERAM4 and ERAM0 Display ............................................................ 74 Figure 5.9 Diagram for Allocation to ERAM4 and ERAM0 ..................................................... 75 Figure 5.10 Automatically Copying ROM Contents to ERAM0 ............................................... 76 Figure 5.11 Releasing ERAM0 and ERAM1............................................................................. 77 Figure 5.12 Selection of Automatic Downloading of ERAM contents to ROM Area (On-chip Flash Memory) ........................................................................................ 78 Figure 5.13 Selection of the [Auto allocate for software break] Mode in [ERam] Page............ 79 Figure 5.14 [Breakpoints] Window ........................................................................................... 84 Figure 5.15 [Breakpoint Properties] Dialog Box ([On Chip Break] Page) ................................ 87 Figure 5.16 [On Chip Break Channel 8] Dialog Box ([Address] Page)..................................... 89 Figure 5.17 [On Chip Break Channel 8] Dialog Box ([Data] Page) .......................................... 90 Figure 5.18 [On Chip Break Channel 8] Dialog Box ([Bus State] Page)................................... 92 Figure 5.19 [On Chip Break Channel 8] Dialog Box ([Count] Page) ........................................ 94 Figure 5.20 [On Chip Break Channel 8] Dialog Box ([Action] Page) ....................................... 95 Figure 5.21 [On Chip Break Reset] Dialog Box ([Reset] Page) ................................................ 96 Figure 5.22 [Breakpoint Properties] Dialog Box ([On Chip Break] Page) ................................ 98 Figure 5.23 Selecting 4 for [Sequential Break].......................................................................... 99 Figure 5.24 Selecting 7 for [Sequential Break].......................................................................... 100 Figure 5.25 [Breakpoint Properties] Dialog Box ([On Emulator Break] Page) ......................... 102 Figure 5.26 [On Emulator Break Channel 1] Dialog Box ([Address] Page).............................. 103 Figure 5.27 [On Emulator Break Channel 1] Dialog Box ([Data] Page) ................................... 105 Figure 5.28 [On Emulator Break Channel 1] Dialog Box ([Bus/Area] Page)............................ 107 Figure 5.29 [On Emulator Break Channel 1] Dialog Box ([Probe] Page) ................................. 109 Figure 5.30 [On Emulator Break Channel 1] Dialog Box ([Interrupt] Page)............................. 110
ix
Figure 5.31 Figure 5.32 Figure 5.33 Figure 5.34 Figure 5.35 Figure 5.36 Figure 5.37 Figure 5.38 Figure 5.39 Figure 5.40 Figure 5.41 Figure 5.42 Figure 5.43 Figure 5.44 Figure 5.45 Figure 5.46 Figure 5.47 Figure 5.48 Figure 5.49 Figure 5.50 Figure 5.51 Figure 5.52 Figure 5.53 Figure 5.54 Figure 5.55 Figure 5.56 Figure 5.57 Figure 5.58 Figure 5.59 Figure 5.60 Figure 5.61 Figure 5.62 Figure 5.63 Figure 5.64 Figure 5.65 Figure 5.66 Figure 5.67 Figure 5.68 Figure 5.69 Figure 5.70
x
[On Emulator Break Channel 1] Dialog Box ([Count] Page) ................................. 112 Example of a Software Break Instruction ............................................................... 113 [Breakpoint Properties] Dialog Box ([Software Break] Page) ............................... 114 [Software Break] Dialog Box ([Address] Page) ..................................................... 115 [Trace Acquisition Properties] Dialog Box ([Other] Page) .................................... 117 Trace Acquisition in Free Trace Mode................................................................... 120 Trace Acquisition in Trace-Stop Mode .................................................................. 120 [Trace Acquisition Properties] Dialog Box ............................................................ 122 [Action] Page.......................................................................................................... 124 [Delay] Page ........................................................................................................... 127 [Trace Acquisition Properties] Dialog Box (Sequential Trace Stop) ..................... 129 [Trace Acquisition Properties] Dialog Box ([Other] Page) .................................... 130 Setting the Subroutine Trace Mode ([Action] Page) .............................................. 131 Example of Conditional Trace Mode ..................................................................... 132 Setting the Conditional Trace Mode ([Action] Page) ............................................. 134 [Trace Acquisition Properties] Dialog Box ([Other] Page) .................................... 135 Tracing External Probe Signal................................................................................ 137 [Trace Filter Properties] Dialog Box ([General] Page) .......................................... 138 [Trace] Window ..................................................................................................... 138 [Trace Filter Properties] Dialog Box ([General] Page) .......................................... 141 [Trace Filter Properties] Dialog Box ([Address] Page) .......................................... 143 [Trace Filter Properties] Dialog Box ([Bus/Area] Page) ........................................ 144 [Trace Filter Properties] Dialog Box ([Interrupt] Page) ......................................... 146 [Trace Filter Properties] Dialog Box ([Time] Page)............................................... 148 [Trace Find Properties] Dialog Box ([General] Page)............................................ 150 [System Status] Window (Display of Execution Time) .......................................... 151 [Breakpoint Properties] Dialog Box ([On Chip Break] Page) ................................ 153 [Performance Analysis] Window............................................................................ 155 Example of Time Of Specified Range Measurement.............................................. 157 Example of Start Point To End Point Measurement ............................................... 158 Example of Start Range To End Range Measurement............................................ 159 [Performance Analysis Conditions] Dialog Box..................................................... 161 [Performance Analysis Properties] Dialog Box...................................................... 163 [Performance Analysis] Window ([Value] Selected).............................................. 166 [Performance Analysis] Window (Results of Execution Time Ratios)................... 167 [Profile-List] Window ............................................................................................ 169 [Profile-Tree] Window ........................................................................................... 170 [Profile-Chart] Window (after User Program Execution)....................................... 171 [System Status] Window ........................................................................................ 173 Pulse Output Timing............................................................................................... 177
Figure 5.71 Figure 5.72 Figure 5.73 Figure 5.74 Figure A.1 Figure A.2 Figure A.2 Figure A.2 Figure A.2 Figure A.2 Figure A.2 Figure B.1 Figure C.1 Figure C.2 Figure C.3 Figure C.4 Figure C.5 Figure C.6 Figure F.1
[Stack Trace] Window............................................................................................ 177 [Stack Trace Setting] Dialog Box........................................................................... 178 [AUM] Window ..................................................................................................... 181 [Auto-update Memory -Edit-] Dialog Box ............................................................. 182 Basic Bus Cycle (Software Wait)............................................................................ 246 User System Interface Circuits (1) .......................................................................... 247 User System Interface Circuits (2) .......................................................................... 248 User System Interface Circuits (3) .......................................................................... 249 User System Interface Circuits (4) .......................................................................... 250 User System Interface Circuits (5) .......................................................................... 251 User System Interface Circuits (6) .......................................................................... 252 External Dimensions and Mass of the Emulator...................................................... 253 Connection Using the HS7058ECF61H................................................................... 257 Restrictions on Component Installation ................................................................... 258 Recommended Mount Pad Dimensions of the User System IC Socket.................... 259 Connection Using the Dedicated Connector ............................................................ 261 Size Restrictions for the Installed Components........................................................ 261 Location for Mounting the Connector in the User System....................................... 262 [Misc] Page .............................................................................................................. 286
xi
Tables Table 1.1 Table 1.2 Table 1.3 Table 1.4 Table 2.1 Table 3.1 Table 4.1 Environmental Conditions ......................................................................................... 5 Operating Environment.............................................................................................. 6 Emulator Components (HS7058EPH60H) ................................................................ 7 Optional Component Specifications .......................................................................... 8 Contents of CD-R ...................................................................................................... 16 PC Interface Board Specifications ............................................................................. 29 [General] Page in the [Configuration] Dialog Box Setting Example: Configuration of the [General] Page ..........................................................................35 Table 4.2 Step Command........................................................................................................... 51 Table 5.1 Emulator Functions.................................................................................................... 61 Table 5.2 Setting the Emulator's Operating Conditions ............................................................ 62 Table 5.3 [Configuration] Dialog Box....................................................................................... 64 Table 5.4 [General] Page ........................................................................................................... 66 Table 5.5 [ERam] Page.............................................................................................................. 69 Table 5.6 Program Execution .................................................................................................... 80 Table 5.7 Causes for Termination.............................................................................................. 81 Table 5.8 Operating Status Display ...........................................................................................82 Table 5.9 Step Execution ........................................................................................................... 83 Table 5.10 Break Functions ....................................................................................................... 85 Table 5.11 On-Chip Break Conditions ...................................................................................... 86 Table 5.12 [On Chip Break] Dialog Box Options ..................................................................... 88 Table 5.13 [Address] Page Options ........................................................................................... 89 Table 5.14 [Data] Page Options................................................................................................. 91 Table 5.15 [Bus State] Page Options ......................................................................................... 92 Table 5.16 [Count] Page Options .............................................................................................. 94 Table 5.17 [Action] Page Options ............................................................................................. 95 Table 5.18 [On Chip Break Reset] Dialog Box Option ............................................................. 96 Table 5.19 On-Chip Sequential Break Modes (On Chip Break Channel 1 to 8) ....................... 97 Table 5.20 [Sequential Break] Options (On Chip Break Channel 1 to 8).................................. 99 Table 5.21 On-Emulator Break Conditions ............................................................................... 101 Table 5.22 Options in the [On Emulator Break] Page ............................................................... 103 Table 5.23 [Address] Page Options ........................................................................................... 104 Table 5.24 [Data] Page Options................................................................................................. 106 Table 5.25 [Bus/Area] Page Options ......................................................................................... 107 Table 5.26 [Probe] Page Options............................................................................................... 109 Table 5.27 [Interrupt] Page Options .......................................................................................... 110 Table 5.28 [Count] Page Options .............................................................................................. 112 Table 5.29 [Software Break] Page Options ............................................................................... 115
xii
Table 5.30 [Software Break] Dialog Box Option ...................................................................... 116 Table 5.31 Trace Acquisition Modes......................................................................................... 119 Table 5.32 Trace Stop Conditions .............................................................................................121 Table 5.33 [Trace Acquisition Properties] Dialog Box Options................................................ 123 Table 5.34 [Action] Page Options ............................................................................................. 125 Table 5.35 [Trace Acquisition Condition Channel] Dialog Box Pages ..................................... 126 Table 5.36 [Delay] Page Options............................................................................................... 127 Table 5.37 Conditional Trace Modes ........................................................................................ 133 Table 5.38 [Time measurement unit] Group Box Option .......................................................... 136 Table 5.39 Trace Information Items and Display Format in [Trace] Window........................... 139 Table 5.40 Trace Search Functions............................................................................................140 Table 5.41 [General] Page Option ............................................................................................. 141 Table 5.42 Trace Search Conditions and Pages in the [Trace Filter Properties] Dialog Box .... 142 Table 5.43 [Address] Page Options ........................................................................................... 1 43 Table 5.44 [Bus/Area] Page Options ......................................................................................... 144 Table 5.45 [Interrupt] Page Options .......................................................................................... 147 Table 5.46 [Time] Page Options................................................................................................ 149 Table 5.47 Measurement Modes................................................................................................ 156 Table 5.48 Modes that are Available in the [Performance 1 to 8] Dialog Boxes....................... 159 Table 5.49 [Performance Analysis Conditions] Dialog Box Options ........................................ 162 Table 5.50 Setting Value for Measurement Method .................................................................. 164 Table 5.51 Menu Items for Displaying the Results.................................................................... 166 Table 5.52 Display Format of Results When [Value] is Selected .............................................. 166 Table 5.53 Display Format of Results When [Graph] is Selected ............................................. 167 Table 5.54 Window Provided by the Profiling Data Measurement Function ............................ 168 Table 5.55 Conditions for Starting or Ending the Profiling Data Measurement ........................ 171 Table 5.56 Limitations on Enabled Profiling Function.............................................................. 172 Table 5.57 [System Status] Window Configuration................................................................... 174 Table 5.58 [Session] Sheet Configuration ................................................................................. 174 Table 5.59 [Platform] Sheet Configuration................................................................................ 175 Table 5.60 [Memory] Sheet Configuration ................................................................................ 176 Table 5.61 [Events] Sheet Configuration................................................................................... 176 Table 5.62 [Stack Trace] Window Options ............................................................................... 178 Table 5.63 Options in the Pop-up Menu .................................................................................... 178 Table 5.64 [Stack Trace Setting] Dialog Box Options .............................................................. 179 Table 5.65 Access Types for Displaying and Modifying Contents of Memory ......................... 179 Table 5.66 Characteristics of Displaying and Modifying Contents of Memory......................... 180 Table 5.67 Dialog Boxes for Setting Auto-Update Memory Items............................................ 181 Table 5.68 Address Mask Specification .................................................................................... 183 Table 6.1 List of Commands...................................................................................................... 187
xiii
Table 7.1 Table 7.2 Table 7.3 Table A.1 Table C.1 Table C.2 Table D.1 Table E.1 Table E.2 Table E.3 Table E.4 Table E.5
Error Messages at Initiation....................................................................................... 241 Error Messages during Emulation ............................................................................. 242 HDI Error Messages .................................................................................................. 243 Bus Timing when Using the Emulator (Bus Clock: 20.0 MHz) ............................... 245 User System Interface Board and User Interfaces..................................................... 255 Pin Arrangement on HS7058EPH60H ...................................................................... 263 Emulator State and Operation of Internal Modules................................................... 276 Watchdog Timer Registers ........................................................................................ 279 Delay Time for Signal Connected via the Evaluation Chip Board ............................ 280 Initial Values of Registers in the MCU and the Emulator ......................................... 282 Suspension of Program Execution: Reference Values............................................... 283 Measurement Environment........................................................................................ 283
xiv
Section 1 Overview
This system is an efficient software and hardware development support tool for application systems using the HD64F7058 (hereafter referred to as SH7058) microcomputer developed by Hitachi, Ltd. As peripheral functions for use with its high-speed CPU, the SH7058 incorporates a floating-point unit (FPU), direct memory access controller (DMAC), advanced timer unit (ATU-II), advanced pulse unit (APU), watchdog timer (WDT), compare-match timer (CMT), serial communications interface (SCI), Hitachi controller area network (HCAN), A/D converter, interrupt controller (INTC), I/O ports, memory, etc. The emulator operates in place of the SH7058 and performs realtime emulation of the user system. The emulator also provides functions for efficient hardware and software debugging. The emulator package consists of the SH7058 E6000H station and a user system interface board. The emulator is connected to the user system via the dedicated connector on the evaluation chip board or the user system interface board. PC interface (option) includes a PC interface board (PCI bus and PC card bus; installed on the host computer), a LAN adapter (connected with the network), and a USB adapter (connected with the USB interface). By connecting the emulator to the host computer via those interfaces, the SH7058 E6000H Hitachi Debugging Interface (hereafter referred to as HDI) can be used for debugging. For details on PC interface boards (available for PCI bus and PC card bus specifications), LAN adapter, and USB adapter, refer to their description notes.
1
USB adapter (option)
USB cable (option) PC
PC interface cable (option)
PC interface cable (option) Network
LAN adapter (option)
PC interface cable (option)
PC interface board (option)
E6000H station (HS7058EPH60H)
Evaluation chip board User system interface board HS7058ECF61H) IC socket User system
Figure 1.1 Configuration of the Emulator for the SH7058
2
The emulator provides the following features: 1. Realtime emulation of the MCU at 80 MHz 2. A wide selection of emulation commands, promoting efficient system development 3. On-line help functions to facilitate command usage without a manual 4. Efficient debugging enabled by variable break functions and a mass-storage trace memory (128-kcycles) 5. Parallel access with a command execution during emulation, for example * * Trace data display Emulation memory display and modification
6. Performance analysis Measurement of subroutine execution time and count for evaluating the execution efficiency of user programs 7. A LAN adapter for connecting the emulator to a host computer via a LAN interface (10BASET or 100BASE-TX), allowing loading of the SH7058 E6000H Hitachi Debugging Interface into the host computer. This enables graphic display operations in a multi-window environment, and source-level debugging. 8. A USB adapter for connecting the emulator to a host computer via a USB interface, allowing loading of the SH7058 E6000H Hitachi Debugging Interface into the host computer. This enables graphic display operations in a multi-window environment, and source-level debugging. 9. A PC interface board (for the PCI bus or PC card bus) connected to the host computer through the PC interface cable. The HDI can be loaded into the host computer to enable: * * Graphic display operations in a multi-window environment Source-level debugging
Note: Ethernet(R) is a registered trademark of Xerox Corporation (USA).
3
1.1
Notes on Usage
CAUTION
READ the following warnings before using the emulator product. Incorrect operation will damage the user system and the emulator product. The USER PROGRAM will be LOST.
1. Check all components with the component list after unpacking the emulator. 2. Never place heavy objects on the casing. 3. Observe the following conditions in the area where the emulator is to be used: * * * * * Make sure that the internal cooling fans on the sides of the emulator must be at least 20 cm (8") away from walls or other equipment. Keep out of direct sunlight or heat. Refer to section 1.2, Environmental Conditions. Use in an environment with constant temperature and humidity. Protect the emulator from dust. Avoid subjecting the emulator to excessive vibration. Refer to section 1.2, Environmental Conditions.
4. Protect the emulator from excessive impacts and stresses. 5. Before using the emulator's power supply, check its specifications such as power voltage and frequency. 6. When moving the emulator, take care not to vibrate or otherwise damage it. 7. After connecting the cable, check that it is connected correctly. For details, refer to section 3, Preparation before Use. 8. Supply power to the emulator and connected parts after connecting all cables. Cables must not be connected or removed while the power is on. 9. For details on differences between the MCU and the emulator, refer to appendix E.5, Differences between the Emulator and the MCU.
4
1.2
Environmental Conditions
CAUTION
Observe the conditions listed in table 1.1 when using the emulator. The following environmental conditions must be satisfied, otherwise the user system and the emulator will not operate normally. The USER PROGRAM will be LOST.
Table 1.1 Environmental Conditions
Item Temperature Humidity Vibration Specifications Operating: Storage: Operating: Storage: Operating: Storage: Transportation: AC input power Voltage: Frequency: Ambient gases +10 to +35C -10 to +50C 35 to 80% RH, no condensation 35 to 80% RH, no condensation 2.45 m/s max. 4.9 m/s max. 14.7 m/s max. 100 V to 240 V AC 50/60 Hz 75 W
2 2 2
Power consumption:
There must be no corrosive gases present.
5
Details of the operating environment are listed in table 1.2. Table 1.2 Operating Environment
Item Host computer Operating system Minimum memory capacity for operation Display Empty space in a hard disk Operating Environment IBM PCs and compatible machines that contain Pentium(R) III processors (800 MHz or faster is recommended) Windows(R) 98, Windows(R) Me, Windows NT(R) 4.0, or Windows(R) 2000 32 Mbytes (more than twice the size of the load module is recommended) Resolution better than 800 x 600 (SVGA) is recommended Disk capacity required for installation: 40 Mbytes or more Take the swap area into account when ensuring that there is enough space on your system (more than four times the size of the memory is recommended). PCI bus slot, PC card (PCMCIA), LAN adapter (conforming to IEEE802.3, with 10BASE-T or 100BASE-TX), USB adapter (conforming to V1.1) A pointing device such as a mouse, which can be connected to the host computer and is supported by Windows(R) 98, Windows(R) Me, Windows NT(R) 4.0, and Windows(R) 2000 Required for installing the emulator software or referring to the user's manual
Supported interfaces
Pointing device such as a mouse
CD-ROM drive
6
1.3
Components
The emulator components are listed below. Check all components after unpacking. If any component is missing, contact the sales agency from which the emulator was purchased. 1.3.1 Emulator
Table 1.3 lists the emulator components. Table 1.3 Emulator Components (HS7058EPH60H)
Classification Hardware Item E6000H station Trace cable SH7058 evaluation chip board External probe Quantity 1 1 1 1 Connected to the emulator station Two boards connected via a trace cable Probe input: four, RUN or break output: one Trigger output: one GND: two CD-R HS7058EPH60SR HS7058EPH60HE-P(*) Remarks
AC power cable Software Manual SH7058 E6000H emulator Description Notes on Using the SH7058 E6000H Emulator
1 1 1
Note: `*' indicates a manual revision.
7
1.3.2
Options
In addition to the E6000H station, the options listed in table 1.4 are also available. Refer to each option manual for details on these optional components. Table 1.4 Optional Component Specifications
Item User system interface board for the SH7058 (FP-256H) PCI interface board PC interface card LAN adapter Model Name HS7058ECF61H Specifications For the SH7058 (FP-256H)
HS6000EIC01H HS6000EIC02H HS6000EIP01H HS6000ELN01H
PCI bus PC card bus * TCP/IP communications protocol * 10BASE-T * 100BASE-TX
USB adapter
HS6000EIU01H
Conforms to V1.1
8
Section 2 Components
2.1 Emulator Hardware Components
The emulator consists of an E6000H station and an SH7058 evaluation chip board. By installing a user system interface board (option) on your host computer, the emulator can be connected in the same package as the device. PC interface (option) includes a PC interface board (PCI bus and PC card bus; installed on the host computer), a LAN adapter (connected with the network), and a USB adapter (connected with the USB interface). By connecting the emulator to the host computer via those interfaces, the SH7058 E6000H Hitachi Debugging Interface (hereafter referred to as HDI) can be used for debugging. For details on PC interface boards (available for PCI bus and PC card bus specifications), LAN adapter, and USB adapter, refer to their description notes.
USB cable (option) PC PC interface cable (option) PC interface cable (option) Network
LAN adapter (option)
USB adapter (option)
PC interface cable (option)
PC interface board (option)
E6000H station (HS7058EPH60H)
Evaluation chip board User system interface board HS7058ECF61H) IC socket User system
Figure 2.1 Emulator Hardware Components
9
2.1.1
E6000H Station Components
The names of the components on the front/rear panel of the E6000H station are listed below. Front Panel:
Figure 2.2 E6000H Station: Front Panel 1. POWER lamp: 2. RUN lamp: Is lit up while the E6000H station is supplied with power. Is lit up while the user program is running.
10
Rear Panel:
Figure 2.3 E6000H Station: Rear Panel (a) Power switch: Turning this switch to I (input) supplies power to the emulator (E6000H station and evaluation chip board). For an AC 100-V to 240-V power supply. For the PC interface cable that connects the host computer to the E6000H station. A PC interface board, PC card interface, LAN adapter, or USB adapter can be connected. Marked PC/IF.
(b) (c)
AC power connector: PC interface cable connector:
11
2.1.2
Evaluation Chip Board Configuration
The names of the components on the evaluation chip board of the emulator are listed below.
Figure 2.4 Evaluation Chip Board (HS7058EPH60H) (a) Station to evaluation chip board interface connector cover: (b) Crystal oscillator terminals: (c) HS7058PWB20H board: (d) HS7058PWB30H board: This is a cover for protecting the connector that connects the E6000H station to the evaluation chip board. For installing a crystal oscillator to be used as an external clock source for the MCU. Connector to the trace cable is attached. An evaluation chip is installed and a dedicated connector to the user system interface board or user system is attached.
12
(e) User system interface board connector:
For connecting the user system interface board or user system.
Note: (a) to (e) listed above are referred to as evaluation chip board.
13
2.1.3
Configuration of User System Interface Board
The names of the components of the user system interface board are given below.
Figure 2.5 Configuration of User System Interface Board (a) Connector for the evaluation chip board (b) Connector for the user system For connection to the evaluation chip board.
For connection to the user system.
14
2.2
Configuration of the Provided CD-R
The provided CD-R contains software for the SH7058 E6000H emulator and user's manuals. Table 2.1 shows the configuration of the CD-R. All directories listed in this table are under the directory 7058 in the root directory.
15
Table 2.1 Contents of CD-R
Directory Name File Name setup.exe Hdi.exe * \Diag \Drivers\Pci\95
[ 1]
Contents Installer HDI program for the SH7058 E6000H emulator
[ 1]
Note
Tm7058.exe * pcihei.inf
Diagnostic and maintenance program Setup information (PCI) For Windows(R) 98 and Windows(R) Me For Windows(R) 98 and Windows(R) Me For Windows NT(R) For Windows(R) 2000 For Windows(R) 2000 For Windows(R) 98 For Windows(R) 98 For Windows NT(R) For Windows(R) 2000 For Windows(R) 2000 PDF documents [ 4] in Japanese * PDF documents [ 4] in Japanese *
\Drivers\Pci\95
pcihei.vxd
Virtual driver (PCI)
\Drivers\Pci\Nt \Drivers\Pci\2000 \Drivers\Pci\2000 \Drivers\Pcmcia\95 \Drivers\Pcmcia\95 \Drivers\Pcmcia\Nt \Drivers\Pcmcia\2000 \Drivers\Pcmcia\2000 \Manuals\Japanese \Manuals\Japanese
pcihei.sys pcihei2k.sys pcihei2k.inf ulepcc.inf ulepcc.vxd ulepccnt.sys ulepcc2k.sys ulepcc2k.inf HS6400DIIW5SJ.pdf [ 2] * HS7058EPH60HJ.pdf [ 2] *
System file (PCI) System file (PCI) Setup information (PCI) Setup information (PCMCIA) Virtual driver (PCMCIA) System file (PCMCIA) System file (PCMCIA) Setup information (PCMCIA) Hitachi Debugging Interface user's manual SH7058 E6000H emulator user's manual
16
Table 2.1 Contents of CD-R (cont)
Directory Name \Manuals\English \Manuals\English \Pdf_read\Japanese \Pdf_read\English \Tutorial Notes: 1. 2. File Name HS6400DIIW5SE.pdf [ 3] * HS7058EPH60HE.pdf [ 3] * Ar50jpn.exe Ar50eng.exe Contents Hitachi Debugging Interface user's manual SH7058 E6000H emulator user's manual Acrobat(R) Reader 5.0 installer Acrobat Reader 5.0 installer Sample program
(R)
Notes PDF documents [ 4] in English * PDF documents [ 4] in English * Japanese version English version
Installed on your host computer by the installer. This is the Japanese version of the manual. It cannot be installed by the Englishlanguage version of the installer. 3. This is the English version of the manual. It cannot be installed by the Japaneselanguage version of the installer. 4. Use the Acrobat(R) Reader to see PDF documents.
17
2.3
System Configuration
The emulator must be connected to a host computer (via the selected PC interface board). 2.3.1 System Configuration Using a PC Interface Board
The emulator can be connected to a host computer via a PC interface board (options: PCI bus or PC card bus). Install the PC interface board to the expansion slot for the interface board in the host computer, and connect the interface cable supplied with the PC interface board to the emulator. A LAN adapter can be used to connect the emulator to a host computer as a network. A USB adapter can be used to connect the emulator to a host computer with the USB interface. For details on PC interface boards (available for PCI bus and PC card bus specifications), LAN adapter, and USB adapter, refer to their description notes. Figure 2.6 shows the configuration of a system in which the PC interface board is used. Figure 2.7 shows the configuration of a system in which the LAN adapter is used. Figure 2.8 shows the configuration of a system in which the USB adapter is used.
Install the PC interface board to the expansion slot for the PC interface board in the host computer.
Figure 2.6 System Configuration Using a PC Interface Board
18
Figure 2.7 System Configuration Using a LAN Adapter
Figure 2.8 System Configuration Using a USB Adapter
19
20
Section 3 Preparation before Use
3.1 Description on Emulator Usage
This section describes the preparation before emulator usage. Figure 3.1 is a flowchart on preparation before the usage of the emulator.
CAUTION
Read this section and understand its contents before preparation. Incorrect operation will damage the user system and the emulator. The USER PROGRAM will be LOST.
Reference: Unpack the emulator. Check the components against the component list.
Component list
Install Acrobat(R) Reader.
See section 3.2. Install the Reader only when it is necessary. See sections 3.3.1 to 3.3.6.
Connect the emulator.
Set up the emulator on each OS.
See the E6000H emulator Hitachi Debugging Interface setup guide.
Turn on the emulator.
Figure 3.1 Emulator Preparation Flowchart
21
3.2
(R)
Installing the Acrobat(R) Reader
(R)
Acrobat Reader 5.0 is required to view the online help. Acrobat Reader is provided on the CD-R (R) of this product. The installation of Acrobat Reader is described below. If you have already (R) installed Acrobat Reader, do not carry out this procedure. 1. 2. 3. 4. Insert the CD-R of this product in the CD-ROM drive. Click [Run...] from the [Start] menu. Specify Ar50eng.exe in Pdf_Read\English directory in the [Run] dialog box (e.g. D:\7058\Pdf_Read\English\Ar50eng.exe) then click the [OK] button. Install according to the instructions displayed in the screen.
3.3
Emulator Connection
The following description is given on emulator connection. 3.3.1 Connecting the User System
WARNING
Always switch OFF the emulator and user system before connecting or disconnecting any CABLES. Failure to do so will result in a FIRE HAZARD and will damage the user system and the emulator or will result in PERSONAL INJURY. The USER PROGRAM will be LOST.
1. Check that the emulator power switch is turned off. Ensure that the power lamp on the right side of the E6000H station's front panel is not lit. 2. Remove the AC power cable of the E6000H station from the outlet (if the cable is connected to the outlet). 3. Connect pin 1 on the user system connector to the connector installed at the bottom of the E6000H user system interface board. When connecting the connector, prevent the upper or lower side of the board from lifting off the connector. Alternately tighten the screws on both sides of the board.
22
3.3.2
Connecting the User System Interface Board
WARNING
Always switch OFF the emulator and user system and check pin numbers on the connectors and IC socket before connecting or disconnecting the USER SYSTEM INTERFACE BOARD. Connection with the power on or incorrect connection will damage the emulator, user system interface board, and user system, and result in a FIRE HAZARD.
For details on the method of connecting the user system interface board, refer to the descriptions of the user system interface boards for individual SH7058 E6000H-series products.
Figure 3.2 Connecting the User System Interface Board
23
3.3.3
Connecting the External Probe
CAUTION
Check the external probe direction and connect the external probe to the emulator station correctly. Incorrect connection will damage the probe or connector.
When an external probe is connected to the emulator probe connector on the E6000H evaluation chip board's rear panel, it enables external signal tracing and multibreak detection. Figure 3.3 shows the external probe connector.
Pin No. 1 2 3 4 5 6 7 8
Probe Name 1 2 3 4 5 6 7 8
Signal Name Probe input 0 Probe input 1 Probe input 2 Probe input 3 GND Trigger output GND RUN or break output
Note Synchronous break input pin
GND connection pin Trigger mode output pin GND connection pin Low-level output at RUNSTEP
Figure 3.3 External Probe Connector
24
3.3.4
Selecting the Clock
This emulator supports three types of clock for the MCU: a crystal oscillator attached on the evaluation chip board, external clock input from the user system, and the emulator internal clock. The clock is specified with the [Configuration] dialog box or the CLOCK command. This emulator can use a clock source () running at up to 80.0 MHz (eight times the external clock frequency of 10.0 MHz) as the MCU clock input.
Crystal Oscillator: A crystal oscillator is not supplied with the emulator. Prepare and use one that has the same frequency as that of the user system. When using a crystal oscillator as the MCU clock source, the frequency range must be from 5.0 to 10.0 MHz.
CAUTION
Always switch OFF the emulator and user system before connecting or disconnecting the CRYSTAL OSCILLATOR. Otherwise, the USER PROGRAM will be LOST.
Use the following procedure to install the crystal oscillator: 1. Check that the emulator power switch is turned off. (Check that the power LED is not lit.) 2. Attach the crystal oscillator into the terminals on the evaluation chip board (figure 3.4). 3. Turn on the user system power and then the emulator power. Then crystal oscillator will be automatically set and setup. This function will allow the execution of the user program at the operating frequency of the user system even when the user system is not connected to the emulator.
25
Enlarged view
Crystal oscillator
X1 Crystal oscillator terminals
X2
Evaluation chip board
Figure 3.4 Installing the Crystal Oscillator External Clock: Use the following procedure to select the external clock. 1. Check that the emulator power switch is turned off. (Check that the power LED is not lit.) 2. Connect the evaluation chip board to the user system and supply a clock through the EXTAL pin from the user system. 3. Turn on the user system power and then the emulator power. USER (the external clock) will then be automatically specified by a CLOCK command. Emulator Internal Clock: Specify 5 (5.0 MHz) or 10 (10.0 MHz) in the [Configuration] dialog box or with the CLOCK command. Reference: When the emulator system program is initiated, the emulator automatically selects the MCU clock source according to the following priority: 1. User system's clock when an external clock is supplied from the user system 2. Crystal oscillator when attached to the evaluation chip board 3. Emulator internal clock
26
3.3.5
Connecting the System Ground
CAUTION
Separate the frame ground from the signal ground at the user system. When the frame ground is connected to the signal ground and the emulator is then connected to the user system, the emulator will malfunction.
The emulator's signal ground is connected to the user system's signal ground via the evaluation chip board. In the E6000H station, the signal ground and frame ground are connected (figure 3.5). At the user system, connect the frame ground only; do not connect the signal ground to the frame ground. If it is difficult to separate the frame ground from the signal ground in the user system, ground the frame to the same outlet as the 100-V to 240-V power supply of the emulator station (figure 3.6) so that the ground potentials become even.
Figure 3.5 Connecting the System Ground
27
WARNING
Always switch OFF the emulator and user system before connecting or disconnecting any CABLES. Failure to do so will result in a FIRE HAZARD and will damage the user system and the emulator or will result in PERSONAL INJURY. The USER PROGRAM will be LOST.
The user system must be connected to an appropriate ground so as to minimize noise and the adverse effects of ground loops. When connecting the evaluation chip board and the user system, confirm that the ground pins of the evaluation chip board are firmly connected to the user system's ground.
Figure 3.6 Connecting the Frame Ground
28
3.3.6
PC Interface Board Specifications (PCI Bus Specifications)
PC Interface Board Specifications: Table 3.1 lists the PCI-bus PC interface board specifications. For details on other interface boards, refer to their description notes. Table 3.1 PC Interface Board Specifications
Item Host computer that can be used OS Memory area PCI-bus specifications Specifications PC with a PCI slot, or compatible machine Microsoft(R) Windows NT(R) 4.0, Windows(R) 98, Windows(R) Me, or Windows(R) 2000 operating system 16 kbytes Conforms to revision 2.1
Installing the PC Interface Board:
WARNING
Always switch OFF the host computer and peripheral devices connected to the host computer before installing the PC interface board. Failure to do so will result in a FIRE HAZARD and will damage the host computer, interface board, and peripheral devices, or will result in PERSONAL INJURY.
Remove the cover of the host computer and install the PC interface board in the PCI-bus specification extension slot. Tighten the screw after confirming that the PC interface cable can be connected to the board.
29
Figure 3.7 Installing the PCI Interface Board Connecting the E6000H Station to the PC Interface Board:
WARNING
Always switch OFF the emulator and user system before connecting or disconnecting any CABLES. Failure to do so will result in a FIRE HAZARD and will damage the user system and the emulator, or will result in PERSONAL INJURY. The USER PROGRAM will be LOST.
Before using the emulator, connect the E6000H station to the PC interface board with the PC interface cable supplied, as shown in figure 3.8.
30
E6000H station rear panel Host computer PC interface board
PC interface cable
Figure 3.8 Connecting the E6000H Station to the PC Interface Board
31
32
Section 4 Tutorial
4.1 Introduction
The following describes the main functions of the HDI by using a sample program for sorting random data. For more complicated usage, refer to section 5, Emulator Functions. This tutorial assumes that the user system is not connected. The sample program performs the following actions: * The main function generates 10 pieces of random data to be sorted. * The sort function generates the array and inputs the random data in the array, and sorts the random data in ascending order. * The change function inputs the array generated by the sort function, and changes the data in descending order. Note: This sample program is created by using the SuperH RISC engine C/C++ compiler Package (V6.0A).
33
4.2
Running the HDI
* To run the HDI, select the [SH7058 E6000H Emulator Software]-[Hitachi Debugging Interface] from the [Start] menu.
Figure 4.1 [Start] Menu The HDI window as shown in figure 4.2 is displayed. Here the [Select Session] dialog box is displayed. Select the target MCU name of the installed HDI and click the [OK] button. The settings related to the MCU, such as the MCU operating mode, can be performed on the [General] page in the [Configuration] dialog box. Table 4.1 lists the settings when running the sample program.
34
Table 4.1 [General] Page in the [Configuration] Dialog Box Setting Example: Configuration of the [General] Page
Option [Device] [Mode] [Clock] [H-UDI (JTAG) Clock] [Timer Resolution] [Input Frequency] [Flash Load Option] [User Signals] [Bus timeout] [Enable interrupts during step execution] [Enable select AUD to Emulator] [Enable multi break] [User VCC Threshold] Setting Value SH7058 3 (On-chip ROM or Single Chip) 5 MHz 10 MHz 20 ns Input prohibited Disabled All enabled 100 us Disabled Enabled Disabled 4.4 V
The settings can be checked on the [General] page in the [Configuration] dialog box. For details on the [General] page in the [Configuration] dialog box, refer to section 5.2, Setting the Emulator's Operating Conditions.
35
The HDI window is shown in figure 4.2.
Figure 4.2 HDI Window Numbers in figure 4.2 indicate the following: 1. Menu bar Indicates the HDI command menus for the use of the HDI. 2. Toolbar Contains convenient buttons as shortcuts of menu commands. 3. Status bar Indicates the state of the emulator and progress information about downloading. 4. [Help] button Activates the HDI on-line help.
36
4.3
Setting the Memory Map
In the next step, allocate the emulation memory. * Select [Configure platform...] from the [Setup] menu to display the current memory map. The [Configuration] dialog box is displayed. Click the [ERam] tab to display the [ERam] page.
Figure 4.3 [ERam] Page (before Setting) The emulator can allocate emulation memory to eight ROM areas in 4-kbyte units. When [Emulation Memory] in the [Mode] group box is selected, the [allocate Emulation RAM on ROM] group box is enabled. In the tutorial program, allocate H'00000000 to H'0000FFF and H'00001000 to H'00001FFF as the emulation memory area.
37
Figure 4.4 Allocating the Emulation Memory * Check the [ERAM0] check box and enter H'00000000 in the address box. Similarly, check the [ERAM1] check box and enter H'00001000 in the address box. The value in the gray address box shows the range that the memory has been allocated. * Click the [OK] button after values have been entered. For details on the allocation of emulation memory, refer to the [ERam] Page in section 5.2.1.
38
4.4
4.4.1
Downloading
Downloading the Sample Program
Download the sample program in the ELF/DWARF2 format to be debugged. * Select [Load Program...] from the [File] menu. The [Load Program] dialog box is displayed. * Click the [Browse...] button. The [Open] dialog box will be displayed. * Select the file TUTORIAL.ABS, and click the [Open] button.
Figure 4.5 [Load Program] Dialog Box * Click the [Open] button in the [Load Program] dialog box. The following dialog box will be displayed when the program completes loading. In the dialog box, the address where the program was loaded is displayed.
Figure 4.6 [HDI] Dialog Box * Click the [OK] button.
39
4.4.2
Displaying the Source Program
The [Source] window allows the user to display the C/C++ language source program, set breakpoints, execute the program, and select variables, so the user can debug a program at the source level. * Select [Source...] from the [View] menu. The [Open] dialog box is displayed.
Figure 4.7 [Open] Dialog Box
40
*
Select [Sort.c] and click the [Open] button. The [Source] window is displayed. If necessary, select whatever font or size you like, by selecting the [Font...] option from the [Customize] submenu in the [Setup] menu.
Figure 4.8 [Source] Window (Displaying the Source Program)
41
4.5
Setting the Program Counter Breakpoints
A breakpoint is one of the debugging functions. The [Source] window provides a very simple way of setting program counter (PC) breakpoints. For example, to set a breakpoint at the line that contains the sort function call: * Double-click the [BP] column on the line containing the sort function call. The * will be displayed on the line containing the sort function to show that a software breakpoint is set at that address.
Figure 4.9 [Source] Window (Setting a PC Breakpoint) The emulator has many break functions. For details, refer to section 5.6, Break Functions.
42
4.6
Executing the Program
* To execute the program, select [Reset Go] from the [Run] menu, or click the [Reset Go] button on the toolbar. The program will be executed up to the breakpoint that has been set, and will then stop. The line where the program has halted will be highlighted in the [Source] window.
Figure 4.10 [Source] Window (Break State)
43
The user can see the cause of the last break through the [Platform] sheet in the [System Status] window. * Select [Status] from the [View] menu. The [System Status] window is displayed. * Select [Platform] sheet from the [System Status] window.
Figure 4.11 [System Status] Window The [Cause of last break] line shows that the cause of the break is On Chip Break 12. For details on program execution, refer to section 5.3, Program Execution.
44
4.7
Reviewing Breakpoints
The user can see all the breakpoints set in the program in the [Breakpoints] window. * Select [Breakpoints] from the [View] menu. The [Breakpoints] window is displayed. The contents of the breakpoint set will be displayed. A will be displayed in the [Enable] column.
*
Figure 4.12 [Breakpoints] Window The [Breakpoints] window also allows the user to change breakpoints, set new breakpoints, and delete breakpoints. * Close the [Breakpoints] window.
45
4.8
Viewing Memory
The user can view the contents of a memory block in the [Memory] window. For example, to view the memory contents corresponding to the external variable array a: * Select [Memory...] from the [View] menu. The [Open Memory Window] dialog box is displayed. * Input a in the [Address] edit box, and set the [Format] combo box as [Long Word].
Figure 4.13 [Open Memory Window] Dialog Box
46
* Click the [OK] button. The [Long Memory] window showing the specified area of memory is displayed.
Figure 4.14 [Long Memory] Window
47
4.9
Watching Variables
As the user steps through a program, it is possible to watch the values of variables used in the program. For example, to check the contents of the long-type array a declared at the beginning of the program, use the following procedure: * Click the left of array a displayed in the [Source] window to position the cursor. * Click the [Source] window with the right mouse button, and select [Instant Watch...] from a pop-up menu. The [Instant Watch] dialog box is displayed.
Figure 4.15 [Instant Watch] Dialog Box * Click the [Add Watch] button to add a variable to the [Watch Window] window.
48
Figure 4.16 [Watch Window] Window (Displaying the Array) The user can also add a variable to the [Watch Window] window by specifying its name. * Click the [Watch Window] window with the right mouse button and select [Add Watch...] from the pop-up menu. The [Add Watch] dialog box is displayed.
Figure 4.17 [Add Watch] Dialog Box * Input variable max and click the [OK] button. The [Watch Window] window will now also show the Volatile long-type variable max.
49
Figure 4.18 [Watch Window] Window (Displaying the Variable) * Double-click the + symbol to the left of array a in the [Watch Window] window to expand the variable and watch all the elements in the array.
Figure 4.19 [Watch Window] Window (Displaying Array Elements)
50
4.10
Stepping Through a Program
The HDI provides various step commands that allow efficient program debugging. For details on step function, refer to section 5.5, Step Functions. Table 4.2 Step Command
Command Step In Description Steps through the statements in a function by each line, or steps through assembly statements by each instruction. (For a line that calls a function, execution stops at the first line of the called function.) Steps through the statements in a function by each line, or steps through assembly statements by each instruction. (For a line that calls a function, the whole of the called function is executed in a single step.) Steps out of a function, and stops at the next line that calls the function in the program. Steps the specified counts repeatedly at a specified rate.
Step Over
Step Out Step...
51
Before executing program stepping, confirm that the program is executed up to the sort function line at address H'0000106c.
Figure 4.20 [Source] Window (Step Execution)
52
4.10.1
Executing [Step In] Command
The [Step In] command steps into the called function and stops at the first line of the function. * To step into the sort function, select [Step In] from the [Run] menu, or click the [Step] button in the toolbar.
Figure 4.21 [Source] Window (Step In) The highlighted line moves to the first line of the sort function in the [Source] window.
53
4.10.2
Executing [Step Out] Command
The [Step Out] command steps out of the called function and stops at the next line that called the function in the program. * To step out of the sort function, select [Step Out] from the [Run] menu, or click the [Step Out] button in the toolbar.
Figure 4.22 [Source] Window (Step Out)
54
The data of array a displayed in the [Watch Window] window is sorted in ascending order.
Figure 4.23 [Watch Window] Display Example (1) To execute two steps, use the [Step In] command twice.
Figure 4.24 [Source] Window (Step Out Step In) The value of variable max displayed in the [Watch Window] window is changed to the maximum data value.
55
Figure 4.25 [Watch Window] Display Example (2)
56
4.10.3
Executing [Step Over] Command
The [Step Over] command executes a line that calls a function as a single step. * Before executing the [Step Over] command, execute two steps up to a line that calls the change function by using the [Step In] command twice.
Figure 4.26 [Source] Window (Before Step Over Execution)
57
* Select [Step Over] from the [Run] menu, or click the [Step Over] button
in the toolbar.
A line that calls the change function is executed as a single step, and execution stops at the next line in the program.
Figure 4.27 [Source] Window (After Step Over Execution) When the last line of the change function is executed, the data of array a, which is displayed in the [Watch Window] window, is sorted in descending order.
Figure 4.28 [Watch Window] Display Example (3)
58
4.11
Displaying Local Variables
The user can see local variables in a function using the [Locals] window. For example, the local variables in the main function, which declares five local variables; a, min, max, j, and i will be examined. Select [Locals] from the [View] menu. The [Locals] window is displayed. When no local variables exist, the [Locals] window is empty.
Figure 4.29 [Locals] Window Double-click the + symbol to the left of array a in the [Locals] window to expand the variable and watch all the elements in the array.
Figure 4.30 [Locals] Window (Displaying Array a Elements)
59
4.12
Saving and Loading the Session
The information set to the HDI windows and dialog boxes can be saved as a session file. Loading this session file at HDI initialization will allow debugging to be resumed from the same state as the last session. To save the session file, select [Save Session As...] from the [File] menu. At this time, the window for specifying the file name is displayed. Input the session file name in the window and click the [Save] button. To load the session file, select [Load Session...] from the [File] menu. A session file can be automatically saved and loaded by setting the [HDI Options] dialog box of [Options...] in the [Setup] menu. To automatically save the session file, click on the [Save session automatically] radio button in the [Session] page. The dialog box for specifying the file at HDI termination is then displayed. Specifying the file name enables session information to be automatically saved to the file from the following HDI termination. To automatically load the session file, enable [Load last session on startup] check box in the [Session] page. The session information is automatically loaded. For more details on sessions and a setting method, refer to the Hitachi Debugging Interface User's Manual on the CD-R.
60
Section 5 Emulator Functions
5.1 Introduction
The following is a full description of the emulator's functions, including those that were not described in section 4, Tutorial. Table 5.1 is a list of the emulator functions that are described in this section. Table 5.1 Emulator Functions
Section 5.2 5.3 5.4 Function Description
Operating mode setting Sets the operating conditions for the emulator Execution Display of cause for termination and operating status Step execution Break Realtime trace Execution time measurement Performance analysis Information display Trigger output Stack trace Emulation Displays the cause for emulation termination and the MCU's operating status Emulation with step execution Break functions Acquires, searches for, and displays tracing information Measures the total execution time of the user program Performance and profile data measurement functions Displays the various items set in each dialog box Trigger outputs Displays the history of called functions
5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 5.13
Displaying memory and Displays memory in one of two ways: by parallel access or the auto-update memory auto-update memory display function (the contents of a range of locations is displayed and the display is updated every 500 ms during execution of the user program) Entering masks Extended function for [Source] window Formats for the input of masks Extended functions for the [Source] window of the HDI
5.14 5.15
61
5.2
Setting the Emulator's Operating Conditions
The user must set the operating conditions before using the emulator. Table 5.2 lists the settings. Table 5.2 Setting the Emulator's Operating Conditions
Setting Emulator settings Item MCU setting Description Selects the MCU to be used. Selects the MCU operating mode. Selects the clock to be supplied to the MCU. Selects the clock to be supplied to the HUDI (JTAG) clock. Selects the measurement unit time for the measurement counter of the execution time. Sets the operation when the on-chip flash memory is used. Enables the use of the emulator function. Interrupt during step execution Selection of the use of the AUD Multibreak mode User signal input setting Enables the use of the user signal input. Enabling the input of the RES signal Enabling the input of the NMI signal Enabling the input of BREQ/WAIT Threshold setting for Bus Time Out Threshold setting for user Vcc Driver setting ERAM setting (Note: Use the [ERam] page to make this setting.) Mode selection Sets the threshold of Bus Time Out. Sets the threshold of user Vcc. Opens the dialog box to change the driver. Selects the mode for the emulation memory. Selecting the user RAM mode Selecting the emulation memory mode Selecting the software-break automatic setting mode for the on-chip ROM area (on-chip flash memory area)
(Note: Use the Operating mode setting [Configuration] dialog Clock setting for MCU box to make these settings.) H-UDI (JTAG) clock setting Minimum measurement time setting for the execution-time measurement counter Operation setting when using the on-chip flash memory Operation setting of the emulator function
62
5.2.1
[Configuration] Dialog Box
Select [Configure Platform...] from the [Setup] menu to open the [Configuration] dialog box.
Figure 5.1 [Configuration] Dialog Box Use this dialog box to set the emulation conditions for the emulator.
63
Table 5.3 [Configuration] Dialog Box
Page [General] Description Selects the MCU, operating clock, H-UDI (JTAG) clock, the minimum measurement time for the execution-time measurement counter, operation when using the on-chip flash memory, and thresholds of bus time out and user Vcc, sets the mode and the clock when programming the on-chip flash memory, enables emulator operation and the input of the user signal, and displays the dialog box to change the driver Selects the mode and sets the address for allocating the emulation memory and automatic copy of the on-chip flash memory to the emulation memory
[ERam]
Each page of the [Configuration] dialog box is described below.
64
[General] Page: Use this page to select the MCU, operating clock, H-UDI (JTAG) clock, the minimum measurement time for the execution-time measurement counter, and threshold of user Vcc, set the mode, enable emulator operation and the input of the user signal, and display the dialog box to change the driver.
Figure 5.2 [Configuration] Dialog Box ([General] Page)
65
Table 5.4 [General] Page
Option [Device] [Mode] Item Selects the MCU SH7xxx 0 (8-bit bus) 1 (16-bit bus) 2 (on-chip ROM) 3 (on-chip ROM, single chip) Target [Clock] Selects the MCU for emulation MCU expansion mode 0 MCU expansion mode 1 MCU expansion mode 2 MCU single chip mode Mode that has been set on the user system Internal clock (x = 5 MHz or 10 MHz) Clock signal for the user system Crystal oscillator on the evaluation chip Frequency x (x = 10 MHz, 15 MHz, or 20 MHz) Selects the operating mode for emulation Description
Selects the clock to be supplied to the MCU Emulator Clock (x MHz) Target clock X'TAL
[H-UDI (JTAG) Clock] [Timer Resolution]
Selects the clock to be input to the H-UDI Frequency
Selects the execution time or the minimum measurement time width of the counter. The value set here affects the display of the runtime and performance. Runtime measurement Clock counter measurement 52 us, 1.6 us, or 20 ns CLOCK, CLOCK/2, CLOCK/4, or CLOCK/8
[Input Frequency]
Sets the clock when programming the on-chip flash memory. The clock is input when X'tal or Target is specified for [Clock]. The value must be input up to two places of decimals between 5.00 MHz to 10.00 MHz. Sets the operation when programming the on-chip flash memory. disable: Programming disabled update: Programs the on-chip flash memory without initialization erase: Initializes and programs the on-chip flash memory of the target block (4 kbytes) all erase: Initializes and programs all the on-chip flash memory
[Flash Load Option]
66
Table 5.4 [General] Page (cont)
Option [User Signals] Item User Reset enable User NMI enable User Bus Request/Wait enable [Enable interrupts during step execution] [Enable select AUD to Emulator] [Enable multi break] [User VCC Threshold] Description Enables the RES signal from the user system Enables the NMI signal from the user system Enables BREQ or Wait from the user system
Specifies whether or not the interrupt is generated during step execution.
Specifies this option when the AUD is used by the emulator. Remove the check mark when used by the user. Specifies whether or not the multibreak is enabled. Detects the lowered user-system voltage. When the mode is Target, the System Status window informs that the user VCC is lowered than the specified value. When the mode is selected, the initial value is changed. This option also informs when the recommended voltage range is exceeded depending on the mode. Specifies the emulator driver. When this dialog box is opened, the emulator is initialized even if the setting is not changed.
[Driver...Change]
Note: When the check mark for [Enable select AUD to Emulator] is removed and the AUD function is used by the user, memory access is disabled during program execution.
67
[ERam] Page: Use this page to select the used mode of emulation memory and to allocate the emulation memory. The emulation memory is mapped to addresses from H'FFFE8000 to H'FFFEFFFF, and used for on-chip ROM emulation. The addresses H'FFFE8000 to H'FFFEFFFF can also be used for onchip RAM. In the actual MCU, the emulation memory is reserved and not installed.
Figure 5.3 [Configuration] Dialog Box ([ERam] Page)
68
Table 5.5 [ERam] Page
Option [Mode] Description Selects the ERAM mode to be used. [User] Uses the emulation memory for on-chip RAM. Addresses from H'FFFE8000 to H'FFFEFFFF can be used as the on-chip RAM. Performs on-chip ROM emulation. The ROM area (on-chip flash memory area) to be emulated is allocated to the address by the [Emulation RAM].
[Emulation Memory]
[Auto allocate for software break] [allocate Emulation RAM on ROM]
Sets the mode to automatically emulate the on-chip ROM when a software break is set on the on-chip ROM. When the emulation memory is selected with [Mode], selects the ERAM area and sets the ROM area address to be emulated. ERAM 0 to 7 Address input Selects the ERAM to be allocated. Inputs the start address of ROM to be emulated. When a value is set outside the 4-kbyte boundary, round down the value below the boundary. Displays the address range of ROM to be emulated. When this checkbox is checked, the contents of the on-chip flash memory are read and written to the emulation memory when the emulation memory is allocated. When the user program is downloaded to the on-chip flash memory in this state, the program is also downloaded to the emulation memory.
Set range address display Checkbox for automatic writing to the on-chip flash memory
Note: Stop the DMAC operation when the emulation memory is set.
69
[User] Mode: The emulation memory is used as the on-chip RAM. The addresses from H'FFFE8000 to H'FFFEFFFF can be used as the on-chip RAM. Figure 5.4 shows the selection in [User] mode, and figure 5.5 shows the emulation memory diagram when the [User] mode is selected.
Figure 5.4 [User] Mode in [ERam] Page
70
Address Start: H'FFFE8000 End: H'FFFE8FFF H'FFFE9000 H'FFFE9FFF H'FFFEA000 H'FFFEAFFF H'FFFEB000 H'FFFEBFFF H'FFFEC000 H'FFFECFFF H'FFFED000 H'FFFEDFFF H'FFFEE000 H'FFFEEFFF H'FFFEF000 H'FFFEFFFF
Emulation Memory ERAM0 ERAM1 ERAM2 ERAM3 ERAM4 ERAM5 ERAM6 ERAM7
Uses the emulation memory in H'FFFE8000 to H'FFFEFFFF as the on-chip RAM.
Figure 5.5 Diagram for Emulation Memory in [User] Mode
71
[Emulation Memory] Mode: The ERAM area can be used for the emulation of the ROM area (on-chip flash memory area). The emulation memory can be allocated in 4-kbyte boundaries. The ROM contents can be downloaded to ERAM automatically, and the ERAM contents can also be downloaded to the ROM area (onchip flash memory) automatically. (a) Emulation Memory Allocation Figure 5.6 shows the display when the ROM area from H'00000000 to H'00000FFF, and H'00001000 to H'00001FFF are allocated to ERAM0 and ERAM1, respectively. Figure 5.7 shows the diagram.
Figure 5.6 Allocation to ERAM0 and ERAM1 Display
72
Address Start: H'00000000 End: H'00000FFF H'00001000 H'00001FFF
ROM
Emulation Memory ERAM0 ERAM1 ERAM2 ERAM3 ERAM4 ERAM5 ERAM6 ERAM7
Address H'FFFE8000 H'FFFE8FFF H'FFFE9000 H'FFFE9FFF H'FFFEA000 H'FFFEAFFF H'FFFEB000 H'FFFEBFFF H'FFFEC000 H'FFFECFFF H'FFFED000 H'FFFEDFFF H'FFFEE000 H'FFFEEFFF H'FFFEF000 H'FFFEFFFF
Figure 5.7
Diagram for Allocation to ERAM0 and ERAM1
73
Figure 5.8 shows the display when the ROM area from H'00000000 to H'00000FFF is allocated to ERAM4, and H'00002000 to H'00002FFF to ERAM0, respectively. Figure 5.9 shows the diagram.
Figure 5.8 Allocation to ERAM4 and ERAM0 Display
74
Address Start: H'00000000 End: H'00000FFF
ROM
Emulation Memory ERAM0 ERAM1
Address H'FFFE8000 : Start H'FFFE8FFF : End H'FFFE9000 H'FFFE9FFF H'FFFEA000 H'FFFEAFFF H'FFFEB000 H'FFFEBFFF H'FFFEC000 H'FFFECFFF H'FFFED000 H'FFFEDFFF H'FFFEE000 H'FFFEEFFF H'FFFEF000 H'FFFEFFFF
H'00002000 H'00002FFF
ERAM2 ERAM3 ERAM4 ERAM5 ERAM6 ERAM7
Figure 5.9 Diagram for Allocation to ERAM4 and ERAM0
75
(b) Automatically Copying ROM Contents to ERAM Figure 5.10 shows the setting when the ROM area from addresses H'00000000 to H'00000FFF and H'00001000 to H'00001FFF are allocated to ERAM0 and ERAM1, respectively, then automatically copying the ROM area from addresses H'00000000 to H'00000FFF contents to ERAM0.
Figure 5.10 Automatically Copying ROM Contents to ERAM0 As shown in figure 5.10, when the [ROM to ERAMn (n = 0 to 7)] checkbox on the right side of the [allocate Emulation RAM on ROM] group box is checked and [OK] is clicked, the contents of the on-chip ROM are written to the area that has been emulated by the specified ERAM.
76
(c) Automatically Writing (Copying) ERAM Contents to the ROM Area (On-chip Flash Memory) When the ERAM is released to the user, the automatic writing (copying) ERAM contents to ROM area (on-chip flash memory) is enabled. As shown in figure 5.6, when the ROM area from addresses H'00000000 to H'00000FFF and H'00001000 to H'00001FFF are allocated to ERAM0 and ERAM1, respectively, and ERAM0 and ERAM1 is released, the display is as shown in figure 5.11. Figure 5.12 shows the selection for automatically writing (copying) ERAM contents to ROM area (on-chip flash memory).
Figure 5.11 Releasing ERAM0 and ERAM1
77
Figure 5.12 Selection of Automatic Downloading of ERAM contents to ROM Area (On-chip Flash Memory) As shown in figure 5.11, remove the checking in the checkbox on the left side of the [allocate Emulation RAM on ROM] group box, and click [OK]. When the check is removed, the display shows the selection whether or not to write the ERAM contents to on-chip ROM (on-chip flash memory) for each ERAM area, so click [Yes] or [No].
78
[Auto allocate for software break] Mode: When a software break is set for the ROM area in the [Auto allocate for software break] mode, the ERAM area is automatically used to emulate the ROM area including the address where the software break has been set. This function enables automatically setting the software break to the ROM area without setting the area to be emulated. The emulation memory is allocated in 4-kbyte boundaries. Figure 5.13 shows the setting of the [Auto allocate for software break] mode.
Figure 5.13 Selection of the [Auto allocate for software break] Mode in [ERam] Page
79
5.3
5.3.1
Program Execution
Execution
Table 5.6 shows the main forms of program execution. Table 5.6 Program Execution
Form Normal execution Function Executes the user program from the current PC (program counter) address. Inputs the RES signal to the MCU, then executes the user program from the reset vector. Sets the program counter to the specified address. Procedure Click the [Go] button Select [Go] from the [Run] menu Click the [Reset Go] button Select [Reset Go] from the [Run] menu Place the mouse cursor on the [Source] window. Then click the [Set PC Here] button or select [Set PC to Cursor] from the [Run] menu Place the mouse cursor on the [Source] window. Then click the [Go to Cursor] button or select [Go to Cursor] from the [Run] menu Select [Run...] from the [Run] menu, specify a start address for [Program Counter] in the [Run] dialog box, specify an end address for [Stop At] in the [Run] dialog box, then click the [Go PC] button. More than one address can be specified as an end address.
Execution from the reset vector Setting a program counter to a specified address Execution to a specified address
Executes the user program to the specified address.
Specifies the end address, and executes the user program up to that address.
Note: The function, which is executed by placing the mouse cursor on the specified address in the [Source] window and then selecting the [Go to Cursor] button, or by selecting [Go to Cursor] from the [Run] menu, uses a channel for the on-chip break. Therefore, when 12 channels of the on-chip break are used with the break condition, this function cannot be used.
80
5.4
Display of Cause for Termination and Operating Status
Cause for Termination: When emulation is terminated, the cause of termination is displayed as the [Cause of last break] on the [Platform] sheet in the [System Status] window, and on the HDI window's status bar. Table 5.7 is a list of the messages that indicate the various causes for termination. Table 5.7 Causes for Termination
Display User Break Software Break On Chip Channel n (n = 1 to 12) On Emulator Break Stepping Completed Stepping Aborted Performance Break Invalid breakpoint Meaning A forced break has been issued via the [STOP] button or [Halt] from the [Run] menu. The break was triggered by a software break. The break was triggered by an on-chip break. The break was triggered by an on-emulator break. A step execution has been completed. A step execution has been aborted. The break was triggered by performance analysis. The break was triggered by an instruction other than PC Break.
81
Operating Status Display: While the user program is in execution, the MCU's operating status is monitored and displayed on the HDI window's status bar. This function allows the user to observe the progress of the program. The display is only updated when the status changes. Table 5.8 is a list of the operating status messages. Table 5.8 Operating Status Display
Display Address=xxxxxxxx Reset Running Meaning During execution of the user program, the address from which operations are fetched is displayed here. The MCU has been reset. The RES signal is low. Execution of the user program has been initiated. This message is displayed once the execution has been started or restarted. Note that this message is deleted when Address=xxxxxxxx starts to be displayed. The MCU is in its sleep mode The WAIT signal is low. This status is displayed when the BREQ signal is low. The MCU is in its bus release mode. The MCU is in its hardware or software standby mode. The RESET pin is low. The VCC is lower than the value that has been set.
Status=SLEEP Status=Bus Timeout WAIT signal = Low Status=BREQ Status=BUSREL Status=STANBY Status=Bus Timeout RES signal = Low Status=VCC Down
82
5.5
5.5.1
Step Functions
Step Execution
Several types of step execution are available, and are shown in table 5.9. Table 5.9 Step Execution
Type Executing each instruction of a function as a single step Executing all instructions of a function as a single step Description Executes each line or instruction as one step. When a function is called, the call is executed, and execution stops at the first line or instruction of the called function. Executes each line or instruction as one step. When a function is called, all instructions of the called function are executed as a single step, and execution stops at the line or instruction immediately after the calling line or instruction. The instructions are executed only in the RAM area on the user system and the area that the emulation memory has been allocated. Executes the specified number of steps. Note that the specified address must be the start of an instruction. If, for example, the address of the second byte of an instruction is specified, execution will not stop, and the specified number of steps will still be executed. Procedure Click the [Step] button. Select [Step In] from the [Run] menu. Click the [Step Over] button. Select [Step Over] from the [Run] menu.
Executing a specified number of steps
Click the [Step dialog] button, specify the number of steps in [Steps] in the [Step Program] dialog box, and start execution. Selecting [Step Over Calls] allows a function call to be executed as a single step. Select [Step...] from the [Run] menu. The settings are the same as above.
Stopping function execution
Steps out of a function. Execution stops at the line after the calling line in the program.
Click the [Step Out] button. Select [Step Out] from the [Run] menu.
Note: Breaks become disabled during step execution. However, the trigger is output.
5.5.2
Accepting Interrupts during Step Execution
Interrupts cannot normally be accepted during step execution. Select [Enable interrupts during step execution] from the [General] page of the [Configuration] dialog box if you want interrupts to be accepted during step execution.
83
5.6
Break Functions
The emulator provides break function shown in table 5.10. The HDI displays a list of breakpoints in the [Breakpoints] window, and the break conditions are specified in the dialog boxes for break functions.
Figure 5.14 [Breakpoints] Window For details on the [Breakpoints] window, refer to the Hitachi Debugging Interface User's Manual (on the CD-R).
84
Table 5.10 Break Functions
Type On-chip break Description A break function incorporated in the MCU. When a condition set for On Chip Break Channel n (n = 1 to 12) has been satisfied, a break occurs. "OnChip" is displayed under Type in the [Breakpoints] window. When all of the conditions have been satisfied in the specified order of the on-chip break conditions, a break occurs. On Chip Break Channel 1 to 8 can be used for four- or eight-level sequential break conditions. On Chip Break Channel Reset is used as a reset point for the sequential break condition (can be set only for On Chip Break Channel 8). This type of break is generated by the dedicated hardware in the emulator. Conditions can be set to On Emulator Break, and when one of these conditions has been satisfied, a break occurs. "OnEmulator" is displayed under Type in the [Breakpoints] window. The contents of the specified address are replaced by a break instruction (a dedicated instruction for use with the emulator), and the program is then executed. When the break instruction is executed, a break occurs. "Software" is displayed under Type in the [Breakpoints] window. This is the break for the forcible termination of a program that is issued when the [STOP] button on the toolbar is pressed. This break occurs when the trace buffer in the emulator overflows during trace acquisition.
On-chip sequential break
On-emulator break
Software break
Forced break Break due to trace buffer overflow
Notes: 1. The [Enable] column in the [Breakpoints] window displays l only when On Chip Break is selected and the Bus/Area condition is Instruction prefetch. When BREAKPOINT is set in other conditions, m is displayed. 2. During user program execution, it is not possible to jump the corresponding source line (or address line) on the [Source] or [Disassemble] window from the breakpoint by using [Go to Source] in the pop-up menu on the [Breakpoints] window.
85
5.6.1
On-Chip Break
Overview: These break functions built in the MCU. The on-chip break conditions are shown in table 5.11. These conditions are satisfied when all of its specified conditions are satisfied (an AND condition). Table 5.11 On-Chip Break Conditions
Break Condition Address bus Data bus Bus/Area Description Satisfied when the address value matches the specified value. Satisfied when the data value matches the specified value. Satisfied when the specified access type, bus status, and read/write cycle conditions are matched. When no condition is set, all bus cycles, including program-fetch cycles, satisfy the condition. This condition is specified in combination with some other conditions. The break occurs when the specified condition has been satisfied the specified number of times. Specifies the reset point condition. This condition is available only for On Chip Break Channel 8. Specifies the operation when the condition has been satisfied.
Satisfaction count
Reset point Operating
The on-chip break uses 12 channels independently and is used as the PC breakpoint that is set by double-clicking the [Source], [Disassembly], or [Label] window. When there is an empty channel, the PC breakpoint that is set by double-clicking is set for that channel. When there is no empty channel, the empty channel for the software break is used as the PC breakpoint. However, in this case, the PC breakpoint cannot be set in the on-chip ROM area (on-chip flash memory area). When the software breakpoint is set in the on-chip ROM area, emulate the ROM area by using the ERAM.
86
Setting an On-Chip Break: The setting of On Chip Break 8 is taken as an example. Select [Edit...] from the pop-up menu in the [Breakpoints] window, and the dialog box (figure 5.15) will appear. Click the [On Chip Break] tab to select the [On Chip Break] page.
Figure 5.15 [Breakpoint Properties] Dialog Box ([On Chip Break] Page)
87
Table 5.12 [On Chip Break] Dialog Box Options
Option [Sequential Break] [Address Range Break] Description Specifies On Chip Break 1 to 8 and the order of halting a breakpoint. Channels are specified in a sequential order. Specifies the combination of channels and the range of halting a break. For channels, select the following: 9-10: Channels 9 and 10 are used to specify the range of break. 11-12: Channels 11 and 12 are used to specify the range of break. [Point To Point Time Measurement] Measures a time between two points by using channels 7 and 8. After channel 7 has been satisfied, the time is measured when channel 8 is satisfied. The measured result is displayed in PtoP Time Count in the [System Status] window, which is EORed to RunTime Count. [Back] [Edit...] [Reset] [Reset All] Puts the setting back when the dialog box has been displayed. Modifies the setting selected in the [Condition] list box. Clicking this button opens the [On Chip Break n] dialog box. (n: channel number.) Clears the settings on the On Chip Break page selected in the [Condition] list box. Clears all settings on the On Chip Break page in the [Condition] list box.
Double-click 8 in the list box by using a mouse. Click the [Edit...] button to open the [On Chip Break 8] dialog box. Close the [On Chip Break 8] dialog box and the display returns to the [On Chip Break] dialog box. The contents of the on-chip break condition set to 8 in the list box are displayed. Click the [OK] button to close the [On Chip Break] dialog box. On-chip break conditions are specified for the other channels in the same way. The following sections describe each page.
88
(a) [Address] Page Use this page to specify the address bus conditions.
Figure 5.16 [On Chip Break Channel 8] Dialog Box ([Address] Page) Table 5.13 [Address] Page Options
Option [Don't Care] [Address] [User mask] Description Selects no address bus condition. Select this button to set the address bus value specified in [Start] as the break condition. Sets mask conditions. Sets the mask bits if [User mask] is selected. Masked bits satisfy this break condition regardless of their values. Notes: 1. Set a multiple of two as the address value when the 16-bit area is accessed. 2. Set a multiple of four as the address value when the 32-bit area is accessed.
89
(b) [Data] Page Use this page to specify the data bus conditions.
Figure 5.17 [On Chip Break Channel 8] Dialog Box ([Data] Page)
90
Table 5.14 [Data] Page Options
Option [Don't Care] [Value] [Access Size] Description Sets no data bus condition. Sets a data bus value as a number. Specifies the data-access size. [Byte]: Sets byte-data-access cycles. [Word]: Sets word-data-access cycles. [Long]: Sets longword-data-access cycles. [Position]: Sets a data bus value as a number. The position of the valid data bus is specified. [Long]: None [Word]: 4n: Upper word 4n + 2: Lower word [Byte]: 4n: Upper byte of the upper word 4n + 1: Lower byte of the upper word 4n + 2: Upper byte of the lower word 4n + 3: Lower byte of the lower word [Use Mask] Sets mask conditions. Sets the mask bits if [User mask] is selected. Masked bits on the data bus satisfy this break condition regardless of their values.
91
(c) [Bus State] Page Use this page to specify conditions for the read or write cycle and access type.
Figure 5.18 [On Chip Break Channel 8] Dialog Box ([Bus State] Page) Table 5.15 [Bus State] Page Options [Access Type] Group Box
Option [Instruction prefetch] [Data] Description Instruction prefetch cycles satisfy this condition. Data access cycles satisfy this condition.
92
[Bus State] Group Box
Option [Don't Care] [CPU] [DMAC] Description All cycles satisfy this condition. CPU cycles satisfy this condition. DMAC cycles satisfy this condition.
[Read/Write] Group Box
Option [Don't Care] [Read] [Write] Description Both of read and write cycles satisfy this condition. Read cycles satisfy this condition. Write cycles satisfy this condition.
93
(d) [Count] Page Use this page to specify a satisfaction count condition.
Figure 5.19 [On Chip Break Channel 8] Dialog Box ([Count] Page) Table 5.16 [Count] Page Options
Option [Don't Care] Input area Description Selects no satisfaction count condition. Sets a value for the satisfaction count condition as a numeric. The default is D'1. Any value in the range from D'1 to D'65535 can be set here.
Note: The satisfaction count condition can be set only for channel 8.
94
(e) [Action] Page Use this page to specify an operating condition when the setting condition has been satisfied.
Figure 5.20 [On Chip Break Channel 8] Dialog Box ([Action] Page) Table 5.17 [Action] Page Options
Option [Break] Description Halts execution when the setting condition has been satisfied. [After execution]: Halts execution after the address at which the condition has been satisfied was executed. [Before execution]: Halts execution before the address at which the condition is satisfied is executed. [Output Trigger] Outputs a trigger when the setting condition has been satisfied. Note: The trigger output when the setting condition has been satisfied can be used only in channels 1 to 8.
95
(f) [Reset] Page Use this page to specify the reset point conditions.
Figure 5.21 [On Chip Break Reset] Dialog Box ([Reset] Page) Table 5.18 [On Chip Break Reset] Dialog Box Option
Option [Address] Description Specifies the reset point with the address conditions.
96
5.6.2
On-Chip Sequential Break
Overview: An on-chip sequential break set up with on-chip break occurs when on-chip break conditions are satisfied in one of three specified orders. As shown in table 5.19, there are two modes for the on-chip sequential break that uses On Chip Break Channel 1 to 8 and Reset. When a reset point condition is satisfied before satisfaction of On Chip Break Channel 8, all the satisfied conditions are cleared. The emulator then restarts checking for satisfaction of the on-chip sequential break conditions from the first condition. Table 5.19 On-Chip Sequential Break Modes (On Chip Break Channel 1 to 8)
Mode 8-level on-chip sequential break Description On Chip Break Channel 1 to 8 are used for sequential break. In this mode, up to eight sequential break conditions can be set. The normal On Chip Break condition can be independently set for On Chip Break Channel 9 to 12. 4-level on-chip sequential break On Chip Break Channel 1 to 4 are used for sequential break. In this mode, up to four sequential break conditions can be set. The normal On Chip Break condition can be independently set for On Chip Break Channel 1 to 4 and 9 to 12.
Note: When the same sequential break conditions are continued, only the first condition is considered as satisfied. In this case, other conditions are not satisfied and no sequential break occurs.
97
Setting an On-Chip Sequential Break: Set the on-chip break conditions. To specify the on-chip sequential break mode, which uses On Chip Break Channel 1 to 8, select [Sequential Break] on the [On Chip Break] page of the [Breakpoint Properties] dialog box. In the example shown in figure 5.22, 8-level on-chip sequential break mode is selected.
Figure 5.22 [Breakpoint Properties] Dialog Box ([On Chip Break] Page) Table 5.20 shows the items selected in [Sequential Break] when the on-chip sequential break is specified using On Chip Break Channel 1 to 8.
98
Table 5.20 [Sequential Break] Options (On Chip Break Channel 1 to 8)
[Sequential Break] Item 8-level on-chip sequential break mode 4-level on-chip sequential break mode Description When either of 1, 2, 3, or 4 is selected, Channels 1 to 8 are always used as a sequential break. Set the different conditions for all of Channels 1 to 8. When either of 5, 6, 7, or 8 is selected, Channels 5 to 8 are always used as a sequential break. Set the different conditions for all of Channels 5 to 8.
Figure 5.23 Selecting 4 for [Sequential Break]
99
Figure 5.24 Selecting 7 for [Sequential Break]
100
5.6.3
On-Emulator Break
Overview: On-emulator break functions are implemented by dedicated hardware in the E6000H station. The on-emulator break conditions have four channels (On Emulator Break 1 to 4). Onemulator break occurs when all of the specified conditions (an AND condition) are satisfied. Table 5.21 On-Emulator Break Conditions
Condition Address bus Data bus Bus/Area Description Satisfied when the value on the address bus matches the specified value. Satisfied when the value on the data bus matches the specified value. Satisfied when the specified access type, bus status, and read/write cycle conditions are matched. When no condition is set, all bus cycles, including program-fetch cycles, satisfy the condition. Satisfied when the external probe (PRB) signal levels match a specification. Satisfied when the external interrupt signal levels match a specification. The break occurs when the above conditions are satisfied the specified number of times.
External probe External interrupt signal Satisfaction count
101
Setting an On-Emulator Break: The setting of On Emulator Break 1 is taken as an example. Place the cursor in the [Breakpoints] window then click the right-hand mouse button to display the window's pop-up menu. Select [Edit...] from the menu, and the dialog box will appear (figure 5.15). Click the [On Emulator Break] tab to select the [On Emulator Break] page (figure 5.25).
Figure 5.25 [Breakpoint Properties] Dialog Box ([On Emulator Break] Page)
102
Table 5.22 Options in the [On Emulator Break] Page
Option [Edit...] Description Modifies the settings on On Emulator Break 1 to 4 selected in the list box. Clicking this button opens the [On Emulator Break Channel n] dialog box. (n: 1 to 4) Clears the settings on On Emulator Break 1 to 4 selected in the list box Clears all settings on On Emulator Break 1 to 4 in the list box.
[Reset] [Reset All]
The following sections describe each page. (a) [Address] Page Use this page to specify the address bus conditions.
Figure 5.26 [On Emulator Break Channel 1] Dialog Box ([Address] Page)
103
Table 5.23 [Address] Page Options
Option [Don't Care] [Address] [Range] Description Selects no address bus condition. Select this button to set the address bus value specified in [Start] as the break condition. A break occurs in the range of the address bus values specified from [Start] to [End]. [Start]: Sets the (start) address bus value as a numeric or a symbol. [End]: Sets the (end) address bus value as a numeric or a symbol. [Outside Range] Selects this option to generate a break with the value set in [Start] or an address bus outside the range set from [Start] to [End].
Notes: 1. Set a multiple of two as the address value when the 16-bit area is accessed. 2. Set a multiple of four as the address value when the 32-bit area is accessed.
104
(b) [Data] Page Use this page to specify the data bus conditions. The data bus condition must be set considering the address bus, data bus width, and access size.
Figure 5.27 [On Emulator Break Channel 1] Dialog Box ([Data] Page)
105
Table 5.24 [Data] Page Options
Option [Don't Care] [Value] [Access Size] Description Sets no data bus condition. Sets a data bus value as a number. Specifies the data-access size. [Byte]: Sets byte-data-access cycles. [Word]: Sets word-data-access cycles. [Long]: Sets longword-data-access cycles. [Position]: Sets a data bus value as a number. The position of the valid data bus is specified. [Long]: None [Word]: 4n: Upper word 4n + 2: Lower word [Byte]: 4n: Upper byte of the upper word 4n + 1: Lower byte of the upper word 4n + 2: Upper byte of the lower word 4n + 3: Lower byte of the lower word [Except this value] [Use mask] Sets a value other than that has been specified as the data bus condition. Sets mask conditions. Sets the mask bits if [User mask] is selected. Masked bits on the data bus satisfy this break condition regardless of their values.
106
(c) [Bus/Area] Page Use this page to specify conditions for the read or write cycle and access type.
Figure 5.28 [On Emulator Break Channel 1] Dialog Box ([Bus/Area] Page) Table 5.25 [Bus/Area] Page Options [Access Type] Group Box
Option [Don't Care] [Instruction prefetch] [Data] Description All access types satisfy this condition. Instruction prefetch cycles satisfy this condition. Data access cycles satisfy this condition.
107
[Bus State] Group Box
Option [Don't Care] [CPU] [DMAC/AUD] Description All cycles satisfy this condition. CPU cycles satisfy this condition. DMAC and AUD cycles satisfy this condition.
[Read/Write] Group Box
Option [Don't Care] [Read] [Write] Description Both of read and write cycles satisfy this condition. Read cycles satisfy this condition. Write cycles satisfy this condition.
108
(d) [Probe] Page Use this page to specify external probe signal (PRB1 to PRB4) conditions.
Figure 5.29 [On Emulator Break Channel 1] Dialog Box ([Probe] Page) Table 5.26 [Probe] Page Options
Option [Don't Care] [High] [Low] Description Selects no external probe signal state condition. Sets the high level of this external probe signal as a break condition. Sets the low level of this external probe signal as a break condition.
109
(e) [Interrupt] Page Use this page to specify external interrupt (IRQ0 to IRQ7) and NMI signal conditions.
Figure 5.30 [On Emulator Break Channel 1] Dialog Box ([Interrupt] Page) Table 5.27 [Interrupt] Page Options [IRQ0 to IRQ7] Group Box
Option [Don't Care] [High] [Low] Description Selects no external interrupt signal state condition. Sets the high level of this external interrupt signal as a break condition. Sets the low level of this external interrupt signal as a break condition.
110
[NMI] Group Box
Option [Don't Care] [High] [Low] Description Selects no NMI signal-state condition. Sets the high level of the NMI signal as a break condition. Sets the low level of the NMI signal as a break condition.
111
(f) [Count] Page Use this page to specify a satisfaction count condition.
Figure 5.31 [On Emulator Break Channel 1] Dialog Box ([Count] Page) Table 5.28 [Count] Page Options
Option [Don't Care] Input area Description Selects no satisfaction count condition. Sets a value for the satisfaction count condition as a numeric. The default is D'1. Any value in the range from D'1 to D'65535 can be set here.
112
5.6.4
Software Break
Overview: Any content at the specified address is replaced by a break instruction (a dedicated instruction for use with the emulator). Execution of the user program stops when the break instruction is executed. The instruction that had been at the address is not executed, so the result is a break before execution. It is possible to specify up to 255 software breakpoints.
User program
Program flow
1000
Instruction
A break occurs after the replaced instruction at address H'1000 is executed.
Figure 5.32 Example of a Software Break Instruction The software break cannot be set in the on-chip ROM area (on-chip flash memory area). To set the software break in the on-chip ROM area, use the ERAM and emulate the ROM area.
113
Setting a Software Break: Place the cursor in the [Breakpoints] window and click the right-hand mouse button to display the pop-up menu. Select [Add...] from the menu, and the [Breakpoint Properties] dialog box (figure 5.15) will appear. Click the [Software Break] tab and select the [Software Break] page (figure 5.33).
Figure 5.33 [Breakpoint Properties] Dialog Box ([Software Break] Page)
114
Table 5.29 [Software Break] Page Options
Option [Edit...] [Reset] [Reset All] Description Allows the user to modify the software breakpoint settings. Clicking the [Edit...] button by selecting the list box displays the [Address] dialog box. Clears the software breakpoint settings selected in the list box. Clears all software breakpoints.
Clicking the [Edit...] button by selecting the list box in the [Software Break] page displays the [Software Break] dialog box. For the software break, only the [Address] page is displayed. Specify the breakpoint's address, then click the [OK] button.
Figure 5.34 [Software Break] Dialog Box ([Address] Page) The display returns to the [Software Break] page. The list box now displays the specified address. Click the [OK] button to close the [Breakpoint Properties] dialog box.
115
Table 5.30 [Software Break] Dialog Box Option
Option [Address] Description Sets the breakpoint's value as a numeric.
When a software break is set, the instruction at the specified address is replaced. It is only possible to set a software break in the RAM area (including the emulation memory). However, it is not possible to set a software breakpoint at an address that satisfies any of these conditions: * The address holds H'0000 * The address is in any area other than CS area (except the on-chip ROM/RAM area) * The address of the delay slot for a delayed-branch instruction Notes: 1. The maximum number of software breakpoints and [Stop At] settings allowed in the [Run Program] dialog box is 255. Therefore, when 255 software breakpoints have been set, any further specification made by using the [Stop At] item in the [Run Program] dialog box is invalid. Ensure that the total number of software breakpoints and settings made by using the [Stop At] item in the [Run Program] dialog box is 255 or less. 2. When a disabled breakpoint address is specified as a [Stop At] item in the [Run Program] dialog box, the breakpoint becomes enabled after the first time that execution subsequently stops at that address. 3. If it is not possible to correctly set a breakpoint when a session file is loaded, the breakpoint is registered as DISABLE in the [Breakpoints] window. 4. Software breakpoints are ignored during step execution. 5. Do not set a break immediately after the delayed branch instruction (slot instruction). If this is attempted, a slot illegal instruction interrupt will occur when the delayed branch instruction is executed, and the break will not occur. Do not allow the user program to modify memory at a breakpoint address. The contents of the specified address where a breakpoint has been set are replaced by a break instruction during emulation. Forced Break
6. 7.
5.6.5
A user program can be forcibly terminated by clicking the [STOP] button or by selecting [Halt] from the [Run] menu.
116
5.6.6
Break Due to Trace-Buffer Overflow
A break occurs when the trace buffer in the E6000H station overflows during trace acquisition. Select [Stop execution and stop trace] in [When trace-buffer full] on the [Other] page of the [Trace Acquisition Properties] dialog box.
Figure 5.35 [Trace Acquisition Properties] Dialog Box ([Other] Page)
117
5.7
Realtime Trace Functions
The emulator allows realtime trace acquisition of up to 131,070 cycles of the SH7058 bus information. This has no effect on the user system during emulation. A total of up to 65,535 lines of information can be displayed in the HDI's [Trace] window. For details on the [Trace] window, refer to the Hitachi Debugging Interface User's Manual (on the CD-R). 5.7.1 Trace Acquisition Condition
Trace Conditions 1 to 12 are available. Specify a trace acquisition condition on each page of the [Trace Acquisition Properties] dialog box which will be displayed by clicking [Acquisition...] in the pop-up menu of the [Trace] window and the [Action] page in the [Trace Acquisition Condition Channel n] (n: integers 1 to 12). The trace acquisition modes are shown in table 5.31.
118
Table 5.31 Trace Acquisition Modes
Acquisition Mode Free trace Sequential trace stop Description Trace acquisition is continuous; from the start of user-program execution until any of the break conditions is satisfied. An order in which trace conditions must be satisfied can be specified. When all of the conditions are satisfied in the specified order, trace acquisition will stop. Can be specified for Trace Conditions.* Trace acquisition stops when the trace buffer in the emulator overflows.* Trace acquisition stops when a specified condition is satisfied. In this mode, trace acquisition is stopped without halting user program execution.* Instruction and operand accesses are traced during execution in the range between the start address and end address of a specified subroutine, or of a subroutine specified by its start and end addresses. However, when the specified subroutine calls other subroutines, the called subroutine will not be traced. In this mode, trace information is only gathered when access is to instructions and operands in the range specified by the start address and end address, during those bus cycles in which the specified conditions are matched. Trace is acquired only in the position where the specified conditions are satisfied. A pulse is output from the trigger pin when the specified conditions are satisfied.
Trace stop due to an overflow of trace buffer Trace stop
Address range trace
Conditional address range trace
Conditional trace Trigger output
Note: It takes 10 to 11 cycles from the satisfaction of conditions to the halt of trace acquisition.
119
Free Trace Mode: Trace information is acquired continuously from the start of user program execution until any of the break conditions is satisfied. The free trace mode is the default when [Free trace] in the [Trace Acquisition Properties] dialog box is selected regardless of the settings of other conditions.
User program Program flow Break condition is satisfied
Trace memory
Figure 5.36 Trace Acquisition in Free Trace Mode Trace-Stop Mode: (a) Overview Trace acquisition stops when the specified conditions are satisfied.
User program Program flow Trace condition is satisfied Realtime emulation is continued (no break occurs).
Trace memory 130,170 bus cycles
Figure 5.37 Trace Acquisition in Trace-Stop Mode In this mode, execution of the user program will not be suspended but the emulator enters the trace-halt mode.
120
The trace stop conditions are shown in table 5.32. When all of the specified conditions (an AND condition) are satisfied, trace acquisition will stop. Table 5.32 Trace Stop Conditions
Condition Address bus Data bus Bus External probe signal External interrupt signal Satisfaction count Delay Description The condition is satisfied when the value on the address bus matches the specified value. The condition is satisfied when the value on the data bus matches the specified value. The condition is satisfied when the specified access type and read/write cycle conditions match the specification. The condition is satisfied when the external probe (PRB) signal levels match a specification. The condition is satisfied when the external interrupt signal levels match a specification. Trace acquisition stops when the above conditions are satisfied the specified number of times. Trace acquisition stops the specified number of bus cycles after the above conditions have been satisfied. This condition can be set only for Trace Condition 7 and 11.
121
(b) Setting Trace-Stop Mode Conditions Trace Condition 7 is taken as an example of setting a trace-stop mode condition. Place the cursor in the [Trace] window then click the right-hand mouse button to display the popup menu. Select [Acquisition] from the menu, and the [Trace Acquisition Properties] dialog box will appear. Select channel 7 from the list box.
Figure 5.38 [Trace Acquisition Properties] Dialog Box
122
Table 5.33 shows the [Trace Acquisition Properties] options. Table 5.33 [Trace Acquisition Properties] Dialog Box Options
Option [Sequential Trace Stop] [Time measurement between trigger outputs] [Free Trace] [Back] List box Description Specifies channels (1 to 7) sequentially and the order of halting trace. A reset point is specified for ResetPoint. The trace is stopped at reset. Specifies channels that measure the trace time. The time is measured by clicking Use. Channels are used in combination of starting measurement and ending measurement; i.e. 1-2, 3-4, 5-6, and 7-8. Selects free trace. Puts the contents set in the Combination group back when the dialog box has been displayed. Displays the setting status of Trace Condition. The contents of conditions that are currently set are displayed. Channels 1 to 12 and PtoP (Point to Point measurement) setting channel. [Edit...] [Reset] [Reset All] Modifies the Trace Condition settings selected in the list box. Clicking this button opens the [Trace Condition X] dialog box. (X: 1, 2, ..., 11, 12.) Clears the Trace Condition settings selected in the [Condition] list box. Clears all Trace Condition settings.
Notes: 1. When a combination of 1-2, 3-4, or 5-6 is selected for [Time measurement between trigger outputs], the period from starting measurement to ending measurement must be set with an interval of six or more bus cycles. 2. When a combination of 7-8 is selected for [Time measurement between trigger outputs], the period from starting measurement to ending measurement must be set with an interval of 15 or more bus cycles. Double-click 7 in the list box on the [Condition] page by using a mouse. Click the [Edit...] button to open the [Trace Acquisition Condition Channel 7] dialog box. The trace acquisition mode is specified on the [Action] page.
123
Figure 5.39 [Action] Page
124
Table 5.34 [Action] Page Options
Option [After Condition Match] Description Specifies the processing after the trace condition has been satisfied. Select the following items. [Trace Stop] Sets the trace halt mode. Halting trace is selected after the trace condition has been satisfied. [Address Range Trace] Sets the address range trace mode. The trace is acquired by specifying the address range. Combination with the next channel (selected for channels 1, 3, 5, and 7) Uses the next channel to additionally set other acquisition conditions in the range trace and sets the conditional address range trace mode.
[Acquisition Condition] [None]
Sets the conditional trace mode. Selects this option when the starting measurement and ending measurement conditions of [Time measurement between trigger outputs] are set, which does not affect the acquired trace.
[Address] [Output Trigger]
Sets the address range when Address Range Trace is selected. Outputs a trigger externally after the trace condition has been satisfied.
125
Table 5.35 shows the dialog box options for each channel. Table 5.35 [Trace Acquisition Condition Channel] Dialog Box Pages
Dialog Box Channels 1, 2, 3, 4, 5, 6, 8, 9, 10, and 12 Page [Action] [Address] [Data] [Bus/Area] [Probe] [Interrupt] [Count] Channels 7 and 11 [Action] [Address] [Data] [Bus/Area] [Probe] [Interrupt] [Count] [Delay] Description Selects the processing after the trace condition has been satisfied. Sets address bus conditions. Sets data bus conditions. Sets access type and read/write cycle conditions. Sets external probe signal conditions. Sets external interrupt signal conditions. Sets satisfaction count conditions. Selects the processing after the trace condition has been satisfied. Sets address bus conditions. Sets data bus conditions. Sets access type and read/write cycle conditions. Sets external probe signal conditions. Sets external interrupt signal conditions. Sets satisfaction count conditions. Sets delay conditions.
Specify the required conditions on the corresponding pages, then click the [OK] button. The options on each page are the same as those of the on-emulator break, except the [Action] and [Delay] pages. For details of the options on each page, refer to section 5.6.3, On-Emulator Break. Figure 5.40 shows the setting of the [Delay] page and table 5.36 shows the options. Notes: 1. Set a multiple of two as the address value when the 16-bit area is accessed. 2. Set a multiple of four as the address value when the 32-bit area is accessed. 3. The trace-stop mode condition must be set with an interval of six or more bus cycles.
126
Figure 5.40 [Delay] Page Table 5.36 [Delay] Page Options
Option [Don't Care] Input area Description Specifies no satisfaction count conditions. Sets a value for the satisfaction count condition as a numeric. The default is D'1. Values D'2 to D'65535 can be set.
The [Trace Acquisition Condition Channel 7] dialog box closes and the display returns to the [Condition] page. The specified trace-stop conditions will now be displayed as condition 7 in the list box. Click the [Close] button to close the [Trace Acquisition Properties] dialog box. Trace stop conditions for the other channels are specified in the same way. Note: It takes 10 to 11 cycles while the delay condition has been satisfied until the trace acquisition is stopped. Set the delay condition considering the cycle before the trace acquisition is stopped.
127
Sequential Trace Stop: (a) Overview A sequential trace stop occurs after a set of channels of a trace-stop condition has been satisfied in a specified order. This function uses the trace condition; a sequence of up to seven trace-stop conditions and one reset point can be specified as the trace condition. The user must consider the order of satisfaction in specifying trace-stop conditions for the trace condition; tracing only stops when the trace-stop conditions have all been satisfied in the order specified by the user. When the reset point is passed, the record of sequential trace-stop conditions that have been satisfied to that point is cleared, and the emulator restarts checking for satisfaction of the sequential trace-stop conditions from the first condition.
128
(b) Setting a Sequential Trace Stop The 5-level sequential trace is taken as an example of using the sequential trace stop. Place the cursor in the [Trace] window then click the right-hand mouse button to display the popup menu. Select [Acquisition].
Figure 5.41 [Trace Acquisition Properties] Dialog Box (Sequential Trace Stop) Checking 5 for [Sequential Trace Stop] enables using channels 3 to 7 as a sequential trace stop. Conditions for channels 3 to 7 before setting the sequential trace stop are maintained as the sequential trace conditions. Set the trace stop condition for channels 3 to 7. Notes: 1. Set a multiple of two as the address value when the 16-bit area is accessed. 2. Set a multiple of four as the address value when the 32-bit area is accessed.
129
3. The sequential trace stop condition must be set with an interval of six or more bus cycles. Trace Stop Due to Trace Buffer Overflow: A break occurs when the trace buffer in the E6000H station overflows during trace acquisition. Select [Stop trace] in [When trace-buffer full] on the [Other] page of the [Trace Acquisition Properties] dialog box.
Figure 5.42 [Trace Acquisition Properties] Dialog Box ([Other] Page)
130
Subroutine Trace Mode: (a) Overview Instruction and operand accesses are traced during execution in the range between the start address and end address of a specified subroutine, or of a subroutine specified by its start and end addresses. However, when the specified subroutine calls other subroutines, the called subroutine will not be traced. The specification of a subroutine trace mode is described (Trace Condition 1 is taken as an example). Select the [Trace] window and click the right-hand mouse button. Select [Acquisition] from the menu, then the [Trace Acquisition Properties] dialog box is displayed. Select Channel 1 from the list box. Selecting [Address Range Trace] on the [Action] page sets the subroutine trace mode.
Figure 5.43 Setting the Subroutine Trace Mode ([Action] Page) When [Combination with the next channel] is selected and each page of the next channel is set, the trace acquisition condition can be set for the subroutine.
131
When [Combination with the next channel] is selected (only the odd channels can be selected), set each page of the next channel (even channel) corresponding to the selected channels, and click the [OK] button to set the trace acquisition condition. The [Trace Condition 1] dialog box closes and the display returns to the [Trace Acquisition Properties] dialog box. The specified trace acquisition conditions will now be displayed as channel 1 in the list box. Click the [OK] button to close the [Trace Acquisition Properties] dialog box. Subroutine trace modes are specified in the same way. The settings on each page are the same as those of the dialog box for the on-emulator break, except the [Action] page. For details on each page, refer to section 5.6.3, On-Emulator Break. Notes: 1. Set a multiple of two as the address value when the 16-bit area is accessed. 2. Set a multiple of four as the address value when the 32-bit area is accessed. 3. The subroutine trace mode condition must be set with an interval of six or more bus cycles. Conditional Trace Mode: (a) Overview Cycles are only acquired where the specified conditions are satisfied.
User program Program flow Trace buffer Trace acquisition condition is satisfied
Break condition is satisfied
When the user program stops, the trace memory stores trace information from the address at which the trace acquisition condition was satisfied
Figure 5.44 Example of Conditional Trace Mode
132
The conditions for conditional trace mode are shown in table 5.37. Information is acquired when all of the specified conditions (an AND condition) are satisfied. Table 5.37 Conditional Trace Modes
Condition Address bus Data bus Bus/access type External interrupt signal External probe signal Satisfaction count Description Satisfied when the value on the address bus matches the specified value. Satisfied when the value on the data bus matches the specified value. Satisfied when the bus status condition is as specified. Satisfied when the external interrupt signal levels match the specified conditions. Satisfied when the external probe (PRB) signal levels match the specified conditions. Satisfied when the specified conditions match the satisfied counts.
Notes: 1. Set a multiple of two as the address value when the 16-bit area is accessed. 2. Set a multiple of four as the address value when the 32-bit area is accessed. 3. The conditional trace mode condition must be set with an interval of six or more bus cycles. Trace Condition 1 is taken as an example of setting a conditional trace mode. Place the cursor in the [Trace] window then click the right-hand mouse button to display the popup menu. Select [Acquisition...] from the menu, and the [Trace Acquisition Properties] dialog box will appear. Select Channel 1 from the list box. Select [Acquisition Condition] on the [Action] page to set the conditional trace mode.
133
Figure 5.45 Setting the Conditional Trace Mode ([Action] Page) Trigger Output: A low-level pulse is output from the trigger-output probe when the conditions specified for Trace Condition are satisfied during execution of the user program. For details, refer to figure 5.39 and table 5.34.
134
Other Conditions: In the [Other] page of the [Trace Acquisition Properties] dialog box, tracing can be specified to stop on the overflow of the trace buffer, suppressing of DMAC or AUD cycles can be selected, and the minimum period for time stamping of acquired bus-tracing information can be specified.
Figure 5.46 [Trace Acquisition Properties] Dialog Box ([Other] Page) (a) [Suppress] Cycles that are suppressed (not acquired) are selected. The DMAC and AUD cycles are not acquired when [DMAC/AUD] is checked.
135
(b) [Time measurement unit] The minimum period for time stamping is specified. Table 5.38 [Time measurement unit] Group Box Option
Option [Time measurement unit] Description Selects the minimum time for the time stamping of the measured bus trace information from among the values listed below. 20ns: Time stamping is in minimum time units of 20 ns (default). 1.6us: Time stamping is in minimum time units of 1.6 s. 52us: Time stamping is in minimum time units of 52 s. CLOCK: Time stamping is in terms of the number of bus-clock cycles, i.e., is synchronized with the cycles of the system clock () signal. CLOCK/2: Time stamping is in terms of the number of bus-clock cycles, i.e., is synchronized with 1/2 cycle of the system clock () signal. CLOCK/4: Time stamping is in terms of the number of bus-clock cycles, i.e., is synchronized with 1/4 cycle of the system clock () signal. CLOCK/8: Time stamping is in terms of the number of bus-clock cycles, i.e., is synchronized with 1/8 cycle of the system clock () signal.
Click the [Apply] button to set the minimum time, then click the [Close] button. 5.7.2 External Bus Trace Timing
The acquisition of trace information is synchronized with the rising edge of T2 cycles of the CK signal. In each bus cycle, the number of cycles between the end of the previous bus cycle and the end of the current bus cycle is measured. An example of a bus-trace timing for the external probe signal is shown in figure 5.47. Note: When the external probe signal information is traced, changes in the signal may not be traced if its level changes with certain timings. This is because the signal is not synchronized with the CK signal.
136
T1 CK
Tw
T2 (1)
T1
Tw
T2
T1
Tw
T2
T1
Tw
T2
T1
Address
(A)
Data
(A) (2) 0 1 1 (3) X (Undefined)
External probe
Figure 5.47 Tracing External Probe Signal (1) External probe signal (a) Information is traced on the falling edge of the T2 cycle of the CK signal (figure 5.47 (1)). (b) When the level of the external probe signal changes while information is being acquired, this change will not be included in the trace information (figure 5.47 (2)). (c) If the sampling edge and the level of an external probe signal change at the same time, the information traced will be undefined (figure 5.47 (3)). If the sampling edge and asynchronous input signal such as NMI or IRQ changes at the same time, the information traced will also be undefined. (2) Number of clocks Up to three clock cycles of tracing can take place in one bus cycle (A). 5.7.3 Trace Display
Select the trace display format on the [General] page of the [Trace Filter Properties] dialog box. Select [Filter...] from the pop-up menu of the [Trace] window to produce this dialog box.
137
Figure 5.48 [Trace Filter Properties] Dialog Box ([General] Page) Trace Display: The range for display can be specified by setting the start and end pointers in bus cycles (bus cycle pointers) in [Start] and [End] on the [General] page of the [Trace Filter] dialog box. The pointer is a value relative to the location at which the delay condition has been satisfied. Number of bus cycles before the delay condition has been satisfied are indicated by a minus sign (-), while numbers of cycles after the condition's satisfaction are displayed with a plus sign (+).
Figure 5.49 [Trace] Window The items shown in table 5.39 are displayed as trace information in the [Trace] window.
138
Table 5.39 Trace Information Items and Display Format in [Trace] Window
Item Cycle Address CS Description and Format Bus cycle pointer. 32-bit address bus values in 4-bit units. The invalid cycle is shown as `-------'. Areas (CS0 to 3) in the user expansion space in the expansion mode. Nothing is displayed in the non-expansion mode. This item may be displayed before or after the bus cycle that accessed the area in the user expansion space. Label name related to an address (if any). Upper 16-bit instruction code being executed. Nothing is displayed here in cycles that are not instruction-execution cycles. Lower 16-bit instruction code being executed. Nothing is displayed here in cycles that are not instruction-execution cycles. 32-bit data bus values in 4-bit units. Whether the cycle was for reading, writing, or fetching. RD: read cycle WR: write cycle IF: fetch cycle SZ Data size to be accessed. L: longword W: word B: byte Bus Prob NMI IRQ Time Stamp Bus-cycle type conditions for trace. Cycles for CPU, DMAC, and AUM are displayed as CPU, DMAC, and AUM, respectively. External probe (PRB) signal state. x4x3x2x1 (xn is the state of PRBn) (0: low level; 1: high level) NMI signal state. (0: low level; 1: high level) IRQ0 to IRQ7 signal state. x7x6x5x4x3x2x1x0 (xn is the state of IRQn) (0: low level; 1: high level) Time stamp. xxxsxxxmsxxxusxxxns (s: second; ms: millisecond; us: microsecond; ns: nanosecond) When IRQ is selected, an approximate value is displayed for Time Stamp. Time Stamp and Clock are displayed by EORed.
Label Code0 Code1 Data RW
139
Table 5.39 Trace Information Items and Display Format in [Trace] Window (cont)
Item Deltatime Clock Description and Format Difference of time immediately before the cycle. Number of clock cycles from the end of the previous bus cycle to the end of the current bus cycle. Only one of Time Stamp or Clock can be displayed at a time. Source The corresponding source line to the cycle. Clicking in the [Source] column jumps to the [Source] window.
5.7.4
Trace Search Functions
The emulator has the two functions for searching for trace information that are shown in table 5.40. Table 5.40 Trace Search Functions
Search Function Trace Filter Trace Find Description Displays all trace information that satisfies the specified conditions. Jumps to the next record of trace information that satisfies the specified conditions
Trace Filter Function: This function displays all trace information that satisfies the conditions specified in the [Trace] window. The search conditions can be specified in the [Trace Filter Properties] dialog box. Place the cursor in the [Trace] window then click the right-hand mouse button to display the popup menu. Select [Filter...] from the menu, and the [Trace Filter Properties] dialog box will appear. Select [Enable Filter] on the [General] page.
140
Figure 5.50 [Trace Filter Properties] Dialog Box ([General] Page) If there is no trace information in updating the [Trace] window, `No trace data' is displayed in the window (nothing is displayed when there is no trace information at opening the [Trace] window). Table 5.41 [General] Page Option
Option Filter [Cycle] Description Sets a range to be displayed. Set negative values for as cycles before the delay condition was satisfied with the bus cycle on which the conditions are satisfied as the origin (0). [Start] is the pointer to the first bus cycle. [End] is the pointer to the last bus cycle. The input area must always be set.
Specify the required conditions on the corresponding pages, then click the [OK] button. The [Trace Filter Properties] dialog box closes and the search results are displayed in the [Trace] window. The trace search conditions that can be specified and the corresponding pages in the [Trace Filter Properties] dialog box are shown in table 5.42.
141
Table 5.42 Trace Search Conditions and Pages in the [Trace Filter Properties] Dialog Box
Page [General] [Address] Condition -- Address bus Description Sets trace-search range. Searches for records in which the value on the address bus, program counter, or memory access area matches the specified condition. Searches for records in which the value on the data bus matches the specified condition. Searches for records in which access type, read/write access, and BREQ signal match the specified condition. Searches for records in which the external probe signal levels match the specified condition. Searches for records in which the NMI, RES, MRES, or IRQ0 to IRQ7 signal levels match the specified condition. Searches for records in which the time stamp matches the specified condition (time or range).
[Data] [Bus/Area]
Data bus Bus state
[Probe] [Interrupt]
External probe signal External interrupt signal
[Time]
Time stamp
The setting of conditions for [Data] and [Probe] is the same as setting the on-emulator break condition. For details on specifying the conditions, refer to section 5.6.3, On-Emulator Break. The descriptions given below are of [Address], [Bus State], [Interrupt], and [Time] settings. Note: During using the Trace Filter function, do not save the trace.
142
(a) [Address] Page Use the [Address] page to specify bus conditions for use in searching for address bus information.
Figure 5.51 [Trace Filter Properties] Dialog Box ([Address] Page) Table 5.43 [Address] Page Options
Option [Don't Care] [Address] [Range] [Start] [End] [Outside Range] Description No address bus condition is set. Selects the range set as [Start] or [Mask] as a trace-search condition. Selects the range set as [Start] to [End] as a trace-search condition. Sets the (start) address value as a numeric or a symbol. When [Range] is selected, sets the (end) address value as a numeric or symbol. Sets the condition that has not been set as a trace-search condition.
143
(b) [Bus/Area] Page Use the [Bus/Area] page to specify bus conditions for use in searching, i.e., access type and read or write cycle information.
Figure 5.52 [Trace Filter Properties] Dialog Box ([Bus/Area] Page) Table 5.44 [Bus/Area] Page Options [Access Type] Group Box
Option [Don't Care] [Instruction prefetch] [Data] Description Sets all access types as the search condition. Sets CPU instruction fetch cycles as the search condition. Sets data access cycles as the search condition.
144
[Bus State] Group Box
Option [Don't Care] [CPU] [DMAC/AUD] Description Sets all access types as the search condition. Sets CPU cycles as the search condition. Sets DMAC/AUD cycles as the search condition.
[Read/Write] Group Box
Option [Don't Care] [Read] [Write] Description Sets all access types as the search condition. Sets read cycles as the search condition. Sets write cycles as the search condition.
145
(c) [Interrupt] Page Use the [Interrupt] page to specify conditions for the external interrupt signals (IRQ0 to IRQ7) and NMI signal for use in searching.
Figure 5.53 [Trace Filter Properties] Dialog Box ([Interrupt] Page)
146
Table 5.45 [Interrupt] Page Options [IRQ0 to IRQ7] Group Box
Option [Don't Care] [High] [Low] Description The state of the external interrupt signal is not a search condition. Sets the high level of the external interrupt signal as a search condition. Sets the low level of the external interrupt signal as a search condition.
[NMI] Group Box
Option [Don't Care] [High] [Low] Description The state of the NMI signal is not a search condition. Sets the high level of the NMI signal as a search condition. Sets the low level of the NMI signal as a search condition.
147
(d) [Time] Page Use the [Time] page to specify time-stamp conditions for use in the search for external bus trace information.
Figure 5.54 [Trace Filter Properties] Dialog Box ([Time] Page)
148
Table 5.46 [Time] Page Options
Option [Don't Care] [Point] [Range] [From] Description No time stamp condition is set. Sets the trace-search condition to values above the value set as [From]. Sets the range set by [From] to [To] as a trace-search condition. Sets the time-stamp value from which the valid range starts as a numeric (decimal). When any number is omitted, 0 is assumed. [s]: (start) second (0 to 999999) [ms]: (start) millisecond (0 to 999) [us]: (start) microsecond (0 to 999) [ns]: (start) nanosecond (0 to 999) When [Range] is selected, sets the time-stamp value of the end of the range of valid values as a numerical value (decimal). When any number is omitted, 0 is assumed. [s]: (start) second (0 to 999999) [ms]: (start) millisecond (0 to 999) [us]: (start) microsecond (0 to 999) [ns]: (start) nanosecond (0 to 999)
[To]
Note: Do not use this page if number of clock cycles have been selected for display.
149
5.7.5
Trace Find Functions
This function makes the display jump to the trace information item that satisfies the specified conditions in the [Trace] window. The search conditions can be specified in the [Trace Find Properties] dialog box. Search conditions are the same as those for the trace filter functions. Place the cursor in the [Trace] window then click the right-hand mouse button to display the popup menu. Select [Find...] from the menu. Click [Find Next] in the pop-up menu of the [Trace] window to jump to the next trace information item that satisfies the specified conditions. (a) [General] page Select the [General] page, then select the [Search from top] check box to search from the start of the trace information.
Figure 5.55 [Trace Find Properties] Dialog Box ([General] Page)
150
5.8
5.8.1
Measurement of Execution Time
Measuring Normal Execution Time
This function provides a way of measuring the total time taken to execute the user program. The user can use any of the methods shown in section 5.3.1, Execution, to start the user program. The total execution time is the total time with the user program in execution; from the start of execution until the program stops due to the satisfaction of a break condition. The resulting measurement is displayed next to [Run Time Count] in the [Platform] page of the [System Status] window.
Figure 5.56 [System Status] Window (Display of Execution Time)
151
In the window, the user program execution time will be displayed as decimal numbers of hours, minutes, etc. The user can use the [Timer Resolution] on the [General] page in the [Configuration] dialog box to set a maximum period of measurement. The maximum times are approximately 15,860 hours (with a sampling interval during execution of 52 s), 488 hours (with a sampling interval during execution of 1.6 s), or 6 hours (with a sampling interval during execution of 20 ns). 5.8.2 Measuring Execution Time between Satisfaction of Specified Conditions
(1) Point To Point Time Measurement This function is implemented by measuring the time interval of the user program with a trigger output of On Chip Break. The execution time is measured from the satisfaction of On Chip Break 7 until the satisfaction of On Chip Break 8. After On Chip Break 7 has been satisfied, the user program stops on the satisfaction of On Chip Break 8. `On Chip Break' will be displayed as the cause.
152
Figure 5.57 [Breakpoint Properties] Dialog Box ([On Chip Break] Page) Select [From 7 to 8] in the [Point To Point Time Measurement] on the [Breakpoint Properties] dialog box. Set the measurement start condition for break channel 7 from the [On Chip Break 7] dialog box, and the measurement end condition for break channel 8 from the [On Chip Break 8] dialog box. After setting, the execution time can be measured when the user program is executed. The measured result of Point To Point Time Measurement is displayed on the [Platform] page in the [System Status] window.
153
Notes: 1. For the measurement time, the measurement counter used depending on the selected status of [Enable performance counter], which is set on the [General] page in the [Configuration] dialog box, is changed. When [Enable performance counter] is selected and the counter for measurement has 24 bits, the user can select approximately 14 minutes (with a sampling interval during execution of 52 s), 26 seconds (with a sampling interval during execution of 1.6 s), or 0.33 seconds (with a sampling interval during execution of 20 ns). When [Enable performance counter] is not selected and the counter for measurement has 40 bits, the user can select approximately 15,860 hours (with a sampling interval during execution of 52 s), 488 hours (with a sampling interval during execution of 1.6 s), or 6 hours (with a sampling interval during execution of 20 ns). 2. This function is implemented by using a trigger output of On Chip Break. Therefore, when this function is set, [Output Trigger] on the [Action] page of channel 7 or 8 cannot be selected by default.
154
5.9
Performance Analysis Function
Performance analysis applies functions of the emulator to the measurement of performance. 5.9.1 Measuring with E6000H Station Function
The emulator's performance analysis function is for measuring the efficiency of parts of a user program in terms of their execution times against the overall execution time, and for measuring the number of times a part of the user program is executed. * Setting the Conditions for Performance Measurement In the HDI, the user can set the execution efficiency and the execution count through a certain dialog box and display the measured results in the [Performance Analysis] window.
Figure 5.58 [Performance Analysis] Window In the [Performance Analysis] window, you can assign any of eight independent channels. To set a condition, click [Conditions] in the pop-up menu of the [Performance Analysis] window to open the [Performance Analysis Condition] dialog box. Measurement Mode: Table 5.47 shows the measurement modes.
155
Table 5.47 Measurement Modes
Measurement Mode Time Of Specified Range Measurement Description Measures the amount of time spent and the execution count during the last program run in the range between start address and end address. Start measurement when the program has been prefetched in the specified range between start address and end address. Then stop measurement when the program has been prefetched out of the specified range. Restart measurement when the program has been prefetched in the specified range. The execution count is counted whenever the program of the end address in the specified range is fetched. Measured result of the amount of time spent does not include the run time called in the specified range. Set the conditions in the [Performance Analysis Condition 1 to 8] dialog box. Start Point To End Point Measurement Measures the amount of time spent and the execution count during the last program run in the range between start address and end address. Start measurement when the program has been prefetched in the specified range of the start address. Then stop measurement when the program of the end address has been prefetched. The execution count is counted whenever the program of the end address in the specified range is prefetched. Measured result of the amount of time spent includes the run time called in the specified range. For points 1 to 4, the maximum and minimum times in the specified range are measured. Set the conditions in the [Performance Analysis Condition 1 to 8] dialog box. Start Range To End Range Measurement Start time measurement in the prefetch cycle of the start address range. Then stop measurement in the prefetch cycle of the end address range. The execution count is counted up whenever the end address range has passed. Set the conditions in the [Performance Analysis Condition 1, 3, 5, 7] dialog box. Access Count Of Specified Range Measurement Measure the number of counts that accessed the address range of access area from the range specified with the start address and end address. The execution time in the range is measured by Time Of Specified Range Measurement. Set the conditions in the [Performance Analysis Condition 1, 3, 5, 7] dialog box.
156
Table 5.47 Measurement Modes (cont)
Measurement Mode Called Count Of Specified Range Measurement Description Measure the number of counts that called the call range from the range specified with the start address and end address. The execution time in the range is measured by using the Time Of Specified Range Measurement. Specify the start and end addresses in the specified subroutine for the call range. Set the conditions in the [Performance Analysis Condition 1, 3, 5, 7] dialog box.
Notes: 1. Execution of the subroutine is measured by using the value of address bus on the prefetch cycle. When the start or end address is set to an address of the instruction just after a branch instruction or the delay slot instruction, correct measurement is not possible. 2. 3. In Access Count Of Specified Range Measurement, accessing by the DMA is not counted. For [Time Resolution] of [Configuration Properties] selected from [Configure Platform], when the performance measurement condition is set, a value is fixed and cannot be changed.
* Example of Time Of Specified Range Measurement An example of Time Of Specified Range Measurement will be described below: Here, the start address is assumed to be H'1000 and the end address to be H'1FFF. When the user program is running, the emulator will measure the execution time of the user program in the address range from H'1000 to H'1FFF. When the user program jumps to address H'3000, measurement by the emulator will stop. When the user program returns from address H'3FFF, measurement by the emulator will start again.
Address H'0000 Address H'1000 Address H'3000
Measurement range Address H'0FFF Address H'1FFF Address H'3FFF
Figure 5.59 Example of Time Of Specified Range Measurement
157
* Example of Start Point To End Point Measurement In Start Point To End Point Measurement, the emulator starts to measure the execution time after it has passed the start address and continues to measure the time until it reaches the end address. An example of the use of Start Point To End Point Measurement is described below: Here, the start address is assumed to be H'1000 and the end address to be H'1FFF. When the user program is running, the emulator will start to measure the execution time of the user program from the start address (H'1000) until the user program reaches the end address (H'1FFF). When the emulator starts to measure the execution time, it will continue to measure until the user program reaches address H'1FFF or until user program emulation breaks. Therefore, the emulator will continue to measure the execution time of the user program after execution of the user program has jumped to address H'3000.
Address H'0000 Address H'1000 Address H'3000
Measurement range Address H'0FFF Address H'1FFF Address H'3FFF
Figure 5.60 Example of Start Point To End Point Measurement * Example of Start Range To End Range Measurement In Start Range To End Range Measurement, the emulator starts to measure the execution time of the user program in the start address range specified by the user, and continues to measure the execution time of the user program until the user program reaches the end address range. An example of the use of Start Range To End Range Measurement is described below: Here, the start address range is assumed to be from H'1000 to H'13FF and the end address range to be from H'1C00 to H'1FFF. While the user program is running, the emulator will start to measure the execution time of the user program from the start address range (H'1000 to H'13FF) until the user program reaches the end address range (H'1C00 to H'1FFF). When the emulator starts to measure the execution time of the user program, it will not stop until the user program reaches the end address range (H'1C00 to H'1FFF) or a break occurs during emulation. Therefore, the emulator will continue to measure the execution time when the user program jumps to address H'3000.
158
Address H'0000
Address H'1000 Address H'13FF
Address H'3000
Address H'1C00 Address H'1FFF Address H'0FFF Measurement range Address H'3FFF
Figure 5.61 Example of Start Range To End Range Measurement A list of subroutine measurement modes that can be set in the [Performance 1 to 8] dialog box is shown in table 5.48. Table 5.48 Modes that are Available in the [Performance 1 to 8] Dialog Boxes
Channel Number for Performance Analysis Mode Time Of Specified Range Measurement Start Point To End Point Measurement Start Range To End Range Measurement Access Count Of Specified Range Measurement Called Count Of Specified Range Measurement Note: : Can be set. x: Cannot be set. 1 2 x x x 3 4 x x x 5 6 x x x 7 8 x x x
Notes: 1. Two channels are necessary to specify the start and end address ranges for Start Range To End Range Measurement. Therefore, settings for Start Range To End Range Measurement can only be made on odd-numbered channels. In the Access Count Of Specified Range Measurement mode, two channels are required to specify the start and end addresses of the area accessed by the subroutine specified by its start and end addresses. Therefore, settings for the Access Count Of Specified Range Measurement mode can only be made on odd-numbered channels. In the Called Count Of Specified Range Measurement mode, two channels are required to specify the start and end addresses of the subroutine accessed by the first subroutine, itself specified by its start
159
and end addresses. Therefore, settings for the Called Count Of Specified Range Measurement mode can only be made on odd-numbered channels. 2. In Start Point To End Point Measurement, the minimum and maximum time is measured only for channel numbers 1 to 4. Performance Measurement Time: For the measurement time, the measurement counter used depending on the selected status of [Enable performance counter], which is set on the [General] page in the [Configuration] dialog box, is changed. When [Enable performance counter] is selected and the counter for measurement has 40 bits, you can select approximately 15,860 hours (with a sampling interval during execution of 52 s), 488 hours (with a sampling interval during execution of 1.6 s), or 6 hours (with a sampling interval during execution of 20 ns). When [Enable performance counter] is not selected and the counter for measurement has 24 bits, the user can select approximately 14 minutes (with a sampling interval during execution of 52 s), 26 seconds (with a sampling interval during execution of 1.6 s), or 0.33 seconds (with a sampling interval during execution of 20 ns). Notes: 1. For measurement, the following two differences must be considered: (1) 1-resolution (when the resolution is 20 ns, an error is 20 ns) The 1-resolution will be generated when the user program execution is started or stopped (break) and the start and end conditions are satisfied. (2) Frequency stability of crystal oscillator for measurement: 0.01% 2. Set the time interval from the satisfaction of end condition to the satisfaction of the next start condition as larger than one resolution in each measurement mode. If this interval is less than one resolution, the time from the satisfaction of end condition to the satisfaction of the next start condition is measured. In Time Of Specified Range Measurement, the end condition is satisfied when the address is outside of the specified range. In Start Point To End Point Measurement and Start Range To End Range Measurement, the end condition is satisfied when the specified condition has been satisfied. If the same address is specified for them, the measured result of Time Of Specified Range measurement will be larger than that of Start Point To End Point Measurement and Start Range To End Range Measurement. The address bus value of the prefetch cycle is used for each measurement. The measurement is not correct when the end address condition is specified for the address adjacent to the next address of the branch or delayed slot instruction. When the bus trace is displayed, check the operation after the cycle where the branch instruction has been prefetched and set the address for the prefetch cycle that is not executed at branch as the end address.
3.
4.
160
How to Set the Conditions for Measuring the Performance: To set the conditions for measuring the performance, use the [Performance Analysis Conditions] dialog box that can be displayed by clicking [Conditions] in the pop-up menu on the [Performance Analysis] window. An example of the use of Performance Analysis 1 is described below:
Figure 5.62 [Performance Analysis Conditions] Dialog Box
161
Table 5.49 [Performance Analysis Conditions] Dialog Box Options
Option [Condition] Description Displays the execution time and the settings of the subroutines which execution count is measured. Empty is displayed when nothing is set. 1 (Performance Analysis 1 setting) 2 (Performance Analysis 2 setting) 3 (Performance Analysis 3 setting) 4 (Performance Analysis 4 setting) 5 (Performance Analysis 5 setting) 6 (Performance Analysis 6 setting) 7 (Performance Analysis 7 setting) 8 (Performance Analysis 8 setting) [Edit...] Modifies the Performance Analysis settings that are set in the [Condition] list box. Clicking this button displays the [Performance n] dialog box. (n: number) Cancels the Performance Analysis settings that are set in the [Condition] list box. Cancels settings of all the subroutines set in the [Condition] list box.
[Delete] [Del All]
Select 1 in the [Condition] list then press the [Edit...] button. The following explains the [Performance Analysis Properties] dialog box.
162
Figure 5.63 [Performance Analysis Properties] Dialog Box The conditions on execution efficiency are set in this dialog box. These conditions have five modes (Measurement Methods). Set the address detection mode to the prefetch address detection mode in the Access Count Of Specified Range Measurement mode, and to the PC address detection mode in other modes. Table 5.50 shows a list of five modes (Measurement Method).
163
Table 5.50 Setting Value for Measurement Method
Mode Time Of Specified Range Measurement Description Range Name Range Specifies the range name. Specifies the range for Time Of Specified Range Measurement. Start Address End Address Start Point To End Point Measurement Range Name Point Specifies the start address. Specifies the end address.
Specifies the range name. Specifies the range for Start Point To End Point Measurement. Start Address End Address Specifies the start address. Specifies the end address.
Time Out Action
Specifies the operation when a timeout for the execution time measurement or counting out occurs. Disable Disables setting of a timeout value for the execution time measurement or a counted-out value. Stops user program when a timeout for the execution time measurement or counting out occurs. Stops trace acquisition when a timeout for the execution time measurement or counting out occurs.
Break
Trace Stop
Time Out
To specify the minimum unit of the measurement time as 52 us, 1.6 us, and 20 ns, input h (hour), min (minute), s (second), ms (millisecond), us (microsecond), and ns (nanosecond); e.g., 1h 2min 3s 123ms 456us 789ns. A target clock is specified with six digits in hexadecimal; e.g., 123456. A break occurs when each measurement value between the start and end addresses exceeds the timeout value (not the total time). Specifies a counted-up value for measuring the execution count.
Count
164
Table 5.50 Setting Value for Measurement Method (cont)
Mode Start Range To End Range Measurement Description Range Name Start Range Specifies the range name. Specifies the start range for Start Range To End Range Measurement. Start Address End Address End Range Specifies the start address. Specifies the end address.
Specifies the end range for Start Range To End Range Measurement. Start Address End Address Specifies the start address. Specifies the end address.
Access Count Of Specified Range Measurement
Range Name Range
Specifies the range name. Specifies the start range for Access Count Of Specified Range Measurement. Start Address End Address Specifies the start address. Specifies the end address.
Access Area Range
Specifies the end range for Access Count Of Specified Range Measurement. Start Address End Address Specifies the start address. Specifies the end address. All accesses DMAC cycle CPU prefetch cycle CPU data cycle
Access Type
Selects the bus cycle in the access area. Don't Care DMAC CPU Prefetch CPU Data
Called Count Of Specified Range Measurement
Range Name Range
Specifies the range name. Specifies the start range for Called Count Of Specified Range Measurement. Start Address End Address Specifies the start address. Specifies the end address.
Call Range
Specifies the end range for Called Count Of Specified Range Measurement. Start Address End Address Specifies the start address. Specifies the end address.
165
Displaying the Results of Performance Measurement: The results of performance measurement are displayed in the [Performance Analysis] window. To display the results, click the right-hand mouse button with the cursor in the [Performance Analysis] window then select a menu item from the pop-up menu. The menu items are shown in table 5.51. Table 5.51 Menu Items for Displaying the Results
Menu Item [Value] [Graph] Description Displays the execution time and count (default). Displays the proportions of execution time to the whole period of execution on a graph.
[Value]: Select [Value] to display the executed results with a numeric as shown in figure 5.64.
Figure 5.64 [Performance Analysis] Window ([Value] Selected) Table 5.52 Display Format of Results When [Value] is Selected
Item [NO] [NAME] [MODE] Contents Channel number. Subroutine name. Measurement mode. Range: Time Of Specified Range Measurement PtoP: Start Point To End Point Measurement RtoR: Start Range To End Range Measurement Ac: Access Count Of Specified Range Measurement Sc: Called Count Of Specified Range Measurement Proportions of execution times. (numerical) Total period of execution (h: hours, min: minutes, s: seconds, us: microseconds, ns: nanoseconds). Access count.
[Rate] [RUN-TIME] [Count]
166
[Graph]: Select [Graph] to display the proportion of total execution time of the user program, as shown in figure 5.65.
Figure 5.65 [Performance Analysis] Window (Results of Execution Time Ratios) Table 5.53 Display Format of Results When [Graph] is Selected
Item [NO] [NAME] [MODE] Contents Channel number. Subroutine name. Measurement mode. Range: Time Of Specified Range Measurement PtoP: Start Point To End Point Measurement RtoR: Start Range To End Range Measurement Ac: Access Count Of Specified Range Measurement Sc: Called Count Of Specified Range Measurement Proportions of execution time (as numerical values and on a graph).
[RATE]
Initializing Performance Measurement Information: To initialize performance measurement information, select [Refresh] from the pop-up menu of the [Performance Analysis] window. Before the initialization, the emulator will display a message box to ask you if you want to initialize the information. To initialize the information, press the [Yes] button.
167
5.9.2
Profiling Function
Profiling Data Measurement Function: This function is used to collect and measure the elapsed time in each function. Program execution and suspension are repeated and a difference will be included. In the HDI, three windows shown in table 5.54 are provided. For details, refer to the Hitachi Debugging Interface User's Manual on the CD-R. Table 5.54 Window Provided by the Profiling Data Measurement Function
Window [Profile-List] [Profile-Tree] Contents Displays the address, size, the number of calls, and execution time of a function by selecting [Profile-List] from the [View] menu. Displays the relationship of calling functions with a tree structure. In addition, the address, size, stack size, the number of calls, and execution time of a function are displayed. The value of the stack size, the number of calls, and execution time of a function are included in the actual path of calling a function. These items are displayed by selecting [Profile-Tree] from the [View] menu. Displays the relationship of calling functions focusing a certain function. This window opens from the [Profile-List] or [Profile-Tree] window. When a certain function is selected and the right-hand mouse button is clicked in the [Profile-List] or [Profile-Tree] window, a pop-up menu is displayed. When [View Profile-Chart] is selected from the pop-up menu, the relationship of calling functions, selected on the [Profile-Chart] window, is displayed. The focused function is displayed at center, the calling source function at left, and calling destination function at right. The value by the side of the calling source and calling destination functions are the number of calls.
[Profile-Chart]
* Measuring the Profiling Data Downloading the load module Download the ELF/DWARF2-type load module. Switching the profiling data measurement function To enable collecting the profiling data, select [Enable Profiler] from the pop-up menu in the window (any shown in table 5.54) and click the left of a text. To disable collecting the profiling data, select [Enable Profiler] again and remove the mark at the left of the text. [Profile-List] window The address ([Address] cell), size ([Size] cell), the number of calls ([Times] cell), and execution time of a function are displayed. The following shows an example after the user program has been executed.
168
Figure 5.66 [Profile-List] Window Notes: 1. If there is no information file for the amount of stack used (extension is `.sni') that is output from the optimizing linkage editor, only the function, that has been executed at measuring the profiling data, is displayed. For details, refer to the manual of the optimizing linkage editor. 2. The [Select Data] in the pop-up menu is invalid.
169
[Profile-Tree] window The address ([Address] cell), size ([Size] cell), stack size ([Stack Size] cell), the number of calls ([Times] cell), and execution time of a function are displayed. The following shows an example after the user program has been executed.
Figure 5.67 [Profile-Tree] Window Note: The stack size differs from the actual value. It should be the target in the actual path of calling a function. If there is no information file for the amount of stack used (extension is `.sni') that is output from the optimizing linkage editor, the stack size is not displayed. [Profile-Chart] window The relationship of calling functions, selected on the [Profile-List] or [Profile-Tree] window, is displayed. The focused function is displayed at center, the calling source function at left, and calling destination function at right. The value by the side of the calling source and calling destination functions are the number of calls.
170
Figure 5.68 [Profile-Chart] Window (after User Program Execution) Setting the condition for starting or ending the profiling data measurement The measurement period of the profiling data is from the start to end of the user program execution. The following shows the conditions for starting or ending the profiling data measurement. Table 5.55 Conditions for Starting or Ending the Profiling Data Measurement
Condition Start Contents Current PC (program counter) Setting * * Reset vector address End On-emulator break Stop address Halt * * * * [Go] from the [Run] menu ([Go] button on the toolbar) Specifies the start address in [Set PC To Cursor] from the [Run] menu [Reset Go] from the [Run] menu ([Reset Go] button on the toolbar) Sets the [On Emulator Break] dialog box [Go To Cursor] from the [Run] menu ([Go To Cursor] button on the toolbar) [Halt] from the [Run] menu ([Stop] button on the toolbar)
Note: As the end condition, the user program is halted when the break instruction is executed.
171
Limitation on the profiling function When the profiling function is enabled, there are limitations shown in table 5.56. Table 5.56 Limitations on Enabled Profiling Function
Emulation State During user program execution Limitations * * * * * * Settings on software break, on-emulator break, and on-chip break are ignored.* The performance measurement condition is ignored. The trace acquisition condition is ignored. The setting of [When trace-buffer full] in the [Trace Acquisition Properties] dialog box ([Other] page) is ignored. Accessing to memory is disabled (display or modify in the [Memory] or [Disassemble] window). The displayed contents of the [Aum] window are not updated.
Note: Do not use the profiling function for the standby mode in the user program.
* Differences The profile function internally breaks user program execution, collects the measured data, and reexecutes the user program. Since the function also counts when the measured item is generated at break or re-execution, a difference will be included in the measured profile value. It takes a long time to start and end the user program execution. The user program execution times under the following environment are shown below. The measured value of this function should be the target. Environment: (R) Host computer: 400 MHz (Pentium II) Memory: 128 Mbytes (R) OS: Windows 98 Execution program: 10,000 nested calls * When the profile function is not used: 1 second or shorter * When the profile function is used in the setting without including a callee function: 20 seconds * When the profile function is used in the setting including a callee function: 400 seconds
172
5.10
Displaying Various Information
The [System Status] window displays a variety of information set by each dialog box. Open the [System Status] window by selecting [Status] from the [View] menu.
Figure 5.69 [System Status] Window
173
[System Status] window has the four sheets as shown in table 5.57. Table 5.57 [System Status] Window Configuration
Sheet Name [Session] [Platform] [Memory] [Events] Description Contains such information on the current session as whether a debugging platform is connected and the names of loaded files. Includes the status information on the Emulator, such as the name of the connected emulator. Includes the information related to the current state of memory, such as memory mapping and the memory areas to be used by loaded object files. Contains information on the usage of resources on breakpoints.
The [Session] sheet has the following contents. Table 5.58 [Session] Sheet Configuration
Item [Target System] [Session Name] [Program Name] Description Indicates whether the emulator is connected. A session file name. The name of a load module that is loaded.
The [Platform] sheet has the following contents.
174
Table 5.59 [Platform] Sheet Configuration
Item [Connected To:] [CPU] [Mode] [Clock source] [Run status] [Cause of last break] [Run Time Count] [Trace Count] [Trace Timestamp OverFlow] [Target Mode] [Target FWE] [Clock] [User Wait] [User Reset] [User NMI] [User Breq] [User Standby] [User UWDTOVF] [User IRQ7-0] [User Vcc] [User PVcc1] Description The name of an emulator that is connected. The type of target MCU. The mode that is selected. The clock that is selected. Whether or not the user program is being executed. The cause of termination by a break. The results of measuring the program execution time. The number of all traced results. Whether or not the timestamp of the trace overflows. The mode input from the user system. Whether or not there is the FWE signal input from the user system. Whether or not there is the clock to be input. The state of the WAIT pin. The state of the RES pin. The state of the NMI pin. The state of the BREQ pin. The state of the HSTBY pin. The state of the WDTOVF pin. The state of the IRQ7, IRQ6, IRQ5, IRQ4, IRQ3, IRQ2, IRQ1, and IRQ0 pins. Whether or not the user Vcc is 2.6 V or more when the target system is connected. Whether or not the user PVcc1 voltage satisfies the value specified with User Vcc Threshold in the [Configure Platform] dialog box when the target system is connected. Whether or not the user PVcc2 is 4.2 V or more when the target system is connected. Whether or not the user target system has been connected at activation. Whether or not the evaluation chip board has been connected at activation. Whether or not the optional coverage board has been connected at activation. Current date and time.
[User PVcc2] [User Target] [EV Chip Board] [Coverage Board] [Date/time]
175
The [Memory] sheet has the following contents. Table 5.60 [Memory] Sheet Configuration
Item [Target Device Configuration] [System Memory Resources] [Load Memory Areas] Description The memory-map status of the on-chip module (INTERNAL I/O). The remaining capacity of the emulation memory. The address range of the load module that was loaded.
The [Events] sheet has the following content. Table 5.61 [Events] Sheet Configuration
Item [Resources] Description The number of effective breakpoints that have been set.
5.11
Trigger Output
During execution of the user program, the emulator outputs a low-level pulse from the triggeroutput probe under the following two conditions. * Trace condition satisfaction * Hardware break condition satisfaction Using this pulse as an oscilloscope's trigger input signal makes it easy to adjust the user system hardware. For example, the waveform produced when the user program goes to a specified point can be viewed. When the trigger output is specified by using of the [User Signals] option of the [General] page in the [Configuration] dialog box, a low-level pulse is output for two bus cycles from the trigger output pin after 10 bus cycles in which hardware break and hardware break conditions were satisfied during emulation. The pulse is output until the end of the subsequent bus cycle. If the conditions are satisfied over consecutive bus cycles, the trigger output remains low. When the onchip ROM/RAM is accessed, the timing of pulse output will be as shown in figure 5.70.
176
CK 1 2 3 4 5 6 7 8 9 10 11 Operating frequency: 50 MHz (Extal input: 12.5 MHz)
Address
TRIG 220
40
Unit: ns (Hardware break condition/trace condition satisfaction cycle)
Figure 5.70 Pulse Output Timing Note: No pulse is output from the trigger-output probe when a software break condition is satisfied. In addition, the timing of the pulse output and the pulse width differ according to the condition.
5.12
Stack Trace Function
The stack trace function displays the history of function calls. In the stack trace function, contents of memory are displayed in the [Stack Trace] window. The [Stack Trace] window can be displayed by selecting [Stack Trace] from the [View] menu.
Figure 5.71 [Stack Trace] Window
177
Table 5.62 [Stack Trace] Window Options
Option [Kind] [Name] [Value] Description Symbol type F: Function, P: Function parameter, L: Local variable Symbol name Symbol value, address, and type
Click the right-hand mouse button with the cursor in the [Stack Trace] window. The pop-up menu will be displayed. The menu includes the following options. Table 5.63 Options in the Pop-up Menu
Option [Copy] [Go to Source] [View Setting...] Description Copies the highlighted text to the Windows(R) clipboard so that the text can be pasted to other applications. Displays the source code in the program that corresponds to the selected function in the [Source] window. Opens the [Stack Trace Setting] dialog box and sets the display format of the [Stack Trace] window.
The format of the [Stack Trace Setting] dialog box is displayed in figure 5.72.
Figure 5.72 [Stack Trace Setting] Dialog Box
178
Table 5.64 [Stack Trace Setting] Dialog Box Options
Option [Nest level] [Display symbol] [Display Radix] Description Specifies the number of function call nestings for display in the [Stack Trace] window. Max: 64 Specifies symbols other than functions for display. Specifies whether parameters and local variables will be displayed. Specifies the radix for the display in the [Stack Trace] window.
To refer to the online help system, press the [F1] key after moving the cursor to the [Stack Trace] window.
5.13
5.13.1
Displaying and Updating the Contents of Memory
Displaying and Updating the Contents of Memory during Execution
The emulator accesses memory in three ways to display and update the contents of memory during user program execution. Table 5.65 Access Types for Displaying and Modifying Contents of Memory
Access Type Parallel access Auto update Memory Description Temporarily halts the execution of the user program Automatically updates the display of the contents of memory without stopping the execution of the user program Stop Time Short None Display Enabled Enabled Modification Enabled Disabled
Note: For details on stopped periods and other notes, refer to appendix E.7, Displaying and Modifying the Contents of Memory.
The respective access types have the following characteristics.
179
Table 5.66 Characteristics of Displaying and Modifying Contents of Memory
Access Type Parallel access Target Window/Command Line Windows other than the [Auto update Memory] window that display memory contents Commands to display or modify memory contents [Auto update Memory] window No target command Target Memory Area Memory, on-chip I/O area, onchip RAM, or on-chip ROM Emulation memory
Auto update Memory
Specified address range
The memory refresh function of the HDI ([Memory] or*[Refresh] menu) updates the contents of windows (other than [Auto update Memory]) that display the contents of memory. Therefore, if the memory refresh function is used during execution of the user program, parallel access will occur if the [I/O Registers] window, or the [Memory] window that displays the contents of onchip RAM is opened. 5.13.2 Overview of Auto-Update Memory Function
In an auto-update of memory, the display of the contents of the specified area of memory is refreshed at intervals of 500 ms while the user program is being executed. The function has the following features: Automatically updates, with an interval of approximately 500 ms, the display of the specified memory contents while the user program is being executed. A color may be applied to indicate the contents that have been modified since the last update of the display. Allows the setting of a maximum of 8 points (auto-update memory items), each running for a maximum of 32 bytes. Allows the display of memory contents in ASCII, bit, byte, word, longword, or single-precision floating point formats (with or without a sign, and in decimal or hexadecimal). The following dialog boxes are used to set items for the auto-update memory function.
180
Table 5.67 Dialog Boxes for Setting Auto-Update Memory Items
Dialog Box [Auto-update Memory -Add-] Description Dialog box for registering items for the auto-update memory function. Select the address, format of display, and number of bytes of memory to be displayed. Dialog box for registering other settings for auto-update memory items. In particular, those conditions that depend on the target MCU are set here.
[AUM - Target Details]
In an auto-update of memory, the contents of the specified area of memory are displayed in the [AUM] window. The [AUM] window is displayed by selecting [Auto update Memory Window] from the [View] menu and registering the Auto update Memory item in the [Auto-update Memory -Add-] dialog box.
Figure 5.73 [AUM] Window The [AUM] window displays the selected ranges of memory, and this display is refreshed while the user program is being executed. Up to 8 windows (8 points) can be displayed in the [AUM] window. 5.13.3 Setting Auto update Memory
Points to Be Set And Byte Size to Acquire: Up to 8 points can be set. Up to 32 bytes can be acquired from each point. 5.13.4 Displaying the Auto update Memory
Display format: The auto-update memory function allows the display of memory contents in ASCII, bit, byte, word, longword, single-precision floating point units, or double-precision floating point units (with or without signs, in decimal or hexadecimal). Click the right-hand mouse button with the cursor in the [AUM] window. The pop-up menu will be displayed. Select [Edit...] from the menu to display the [Auto-update Memory -Edit-] dialog box and select [Format] from the [Auto-update Memory -Edit-] dialog box to change the display
181
format, or select [Format] from the pop-up menu of the [AUM] window to change the display format. Display Color: A color is applied to indicate the contents that have been modified since the last update of the display. Select [Type] from the [Color] group box in the [Auto-update Memory Edit-] dialog box. When [Change] is selected as [Type], modified data will be displayed in color. It is also possible to specify the foreground and background colors of the window. If [Gray] is selected, the modified data will be displayed in the color, with the unchanged data displayed in gray. When [Mayfly] is selected, the color is changed every time the contents of the window are updated. To set the display format and display color, use the [Auto-update Memory -Edit-] dialog box. After setting the required items, click the [OK] button.
Figure 5.74 [Auto-update Memory -Edit-] Dialog Box Note: In the situations listed below, the user program will not be executed in realtime. When an auto-update memory item is set or modified while the user program is being executed. When [Format] is modified while the user program is being executed.
182
5.14
5.14.1
Input Format
Entering Masks
Address bus conditions and data bus conditions can be input with masks. Addresses can be masked in 1-, 3-, or 4-bit units. When a bit is masked, it always satisfies the condition. To specify a mask for an address bus condition, specify the mask value in the [Mask] area. The mask for data conditions is similarly specified in the [Mask] area. To specify any further mask, specify 1 for the digits to be ignored. Examples of mask specification is shown below. Table 5.68 Address Mask Specification
No 1 2 3 Input Value Binary Octal Hexadecimal Mask Unit 1 bit 3 bits 4 bits Example B'00000111 O'000017 H'07FF Masked Bits Masks bits 0 to 2 Masks bits 0 to 3 Masks bits 0 to 10
183
5.15
5.15.1
[Source] Window Expanded Function
Setting BP Column
In the HDI, PC (program counter) break can be set, cancelled, or displayed in the BP column of the [Source] window. PC break can be set or cancelled by selecting a PC breakpoint with the left-hand mouse button and double-clicking in the BP column or by placing the cursor at the line where the breakpoint was set and pressing the F9 key. This function is the same as for the BP columns in the [Disassembly] and [Labels] windows. PC break, set on the window, firstly occupies channel 12 of On Chip Break, then subsequently uses channels 11, 10, ..., 3, 2, and 1.
184
Section 6 Command Line
6.1 List Format
This section explains the format for the command list in section 6.2. Some commands are explained on a single page. Some commands are explained over several pages. 6.1.1 Description
The entries are in the following format: Command name (abbreviation) [Command syntax and parameters] Shows input format for each command. [Description] Describes the usage and function of each command. [Examples] Example of usage. [Notes] Notes on using the command. Some entries have no notes. 6.1.2 Format
Symbols used in the command format have the following meanings: < >: [ ]: < >=: |: | |: Contents of < > are parameters. Parameters enclosed by [ ] can be omitted. The parameter shown in the left < > can be expressed in the format in the right < >. One or both can be selected, non-exclusively. Either of two or one can be selected, exclusively.
The parameters of each command are explained in the tables in section 6.2.
185
6.1.3
Parameter Type Input
1. Numerical parameters Numerical parameters must be supplied as binary, octal, decimal, or hexadecimal numbers, symbols, or expressions. A symbol can consist of up to 32 characters. Operators (e.g.: + and -) can be used to delimit expressions. 2. Keyword parameters The bold-faced characters in the tables for each command are the strings that are input as keyword parameters. Only the listed strings can be used. If a string that is not listed is input, an error will occur. 3. String parameters String parameters are used to input mask data, symbols, and file names. When using strings to mask data, specify H' (hexadecimal), O' (octal), or B' (binary) at the head of the data as the radix. Specify 1 for the bits that correspond to the digits to be masked. When a bit is masked, it always satisfies the condition.
No 1 2 3 Input Value Binary Octal Hexadecimal Mask Unit 1 bit 3 bits 4 bits Example B'00000111 O'000017 H'07FF Masked Bits Masks bits 0 to 2 Masks bits 0 to 3 Masks bits 0 to 10
6.1.4
Examples
The examples show how to input the command. When output results, the output is also described.
186
6.2
List of Commands
The following is a list of HDI emulation commands. Sections in this manual are indicated in the second column. If there is no section number, the description is in the Hitachi Debugging Interface User's Manual provided on the CD-R. Table 6.1 List of Commands
Command ! ASSEMBLE ASSERT ANALYSIS Section 6.2.1 Abbreviation AS AN Description Comment Assembles user program. Checks the condition. Displays the result of measurement for the rate of time spent. Sets the conditions for measuring the rate of time spent. Specifies or clears all the conditions for measuring the rate of time spent. Sets on-chip breakpoints. Sets on-chip breakpoints for each channel. Clears on-chip breakpoints. Enables or disables on-chip breakpoints that have been set. Sets a reset point for on-chip breakpoints. Sets on-emulator breaks. Sets on-emulator breaks for each channel. Clears the on-emulator breakpoints that have been set. Enables or disables the onemulator breakpoints that have been set. Sets software breakpoints. Clears software breakpoints that have been set.
ANALYSIS_RANGEn ANALYSIS_RANGE_DELETE
6.2.2 6.2.3
ARn ADn
BREAKPOINT_ONCHIP BREAKPOINT_ONCHIPn BREAKPOINT_ONCHIP _CLEAR BREAKPOINT_ONCHIP _ENABLE BREAKPOINT_ONCHIP _RESET BREAKPOINT_ONEMULATOR BREAKPOINT _ONEMULATORn BREAKPOINT_ONEMULATOR _CLEAR BREAKPOINT_ONEMULATOR _ENABLE BREAKPOINT_SOFTWARE BREAKPOINT_SOFTWARE _CLEAR
6.2.4 6.2.4 6.2.4 6.2.4 6.2.4 6.2.5 6.2.5 6.2.5 6.2.5
BC BCn BCC BCE BCR BE BEn BEC BEE
6.2.6 6.2.6
BS BSC
187
Table 6.1 List of Commands (cont)
Command BREAKPOINT_SOFTWARE _ENABLE CLOCK CONFIGURATION _PLATFORM DEVICE_TYPE DISASSEMBLE ERAM ERASE EVALUATE FILE_LOAD FILE_SAVE FILE_VERIFY FLASH_MEMORY GO GO_RESET GO_TILL HALT HELP INITIALISE LOG MAP_DISPLAY MEMORY_DISPLAY MEMORY_EDIT Section 6.2.6 6.2.7 6.2.8 6.2.9 6.2.10 6.2.11 6.2.12 Abbreviation BSE CK CP DE DA EM ER EV FL FS FV FM GO GR GT HA HE IN LO MA MD ME Description Enables or disables software breakpoints that have been set. Sets and displays the CLOCK signal for the MCU. Sets the operating conditions for the emulator. Displays the type of a currently selected MCU. Disassembles user program and displays the result. Sets the emulation memory or displays the contents. Clears the contents of the Command Line window. Calculates an expression. Loads an object (program) file. Saves the contents of memory as a file. Compares the contents of a file with memory. Erases the contents of the flash memory. Executes the user program. Executes the user program from the reset vector. Executes the user program up to a temporary breakpoint. Halts the user program. Displays help for command lines and commands. Initializes a platform. Manipulates logging file. Displays memory map information. Displays memory contents. Modifies memory contents.
188
Table 6.1 List of Commands (cont)
Command MEMORY_FILL MODE MEMORY_MOVE MEMORY_TEST QUIT RADIX REFRESH REGISTER_DISPLAY REGISTER_SET RESET SLEEP STEP Section 6.2.13 6.2.14 Abbreviation MF MO MV MT QU RA RF RD RS RE ST Description Fills the memory with the specified data. Sets or displays the MCU mode. Moves memory blocks. Tests memory blocks. Terminates HDI. Sets an input radix. Updates the memory information in HDI to reflect the latest state. Displays MCU register values. Sets MCU register values. Resets the MCU. Delays command execution. Executes in steps (specified as instruction units or source line units). Executes until the function represented by the address at the program counter has finished. Steps over function. Sets and displays step execution rate. Executes emulation command file. Sets symbol. Deletes symbol. Loads symbol information file. Saves symbol information file. Displays symbol. Tests the on-chip flash memory area. Displays or modifies the minimum for measurement of time. Sets conditions for acquiring trace information. Makes settings for each channel for acquiring trace information. Clears trace conditions that have been set.
STEP_OUT
6.2.15 6.2.16 6.2.17 6.2.17 6.2.17
SP
STEP_OVER STEP_RATE SUBMIT SYMBOL_ADD SYMBOL_CLEAR SYMBOL_LOAD SYMBOL_SAVE SYMBOL_VIEW TEST_EMULATOR TIMER TRACE_ACQUISITION TRACE_ACQUISITIONn TRACE_ACQUISITION_CLEAR
SO SR SU SA SC SL SS SV TE TI TA TAn TAC
189
Table 6.1 List of Commands (cont)
Command TRACE_COMPARE Section 6.2.18 Abbreviation TC Description Compares the current trace data and the trace file that has been saved (refer to the trace_save section). Saves trace data as a file in the text format. Sets conditions for displaying trace data. Sets or displays user signals.
TRACE_SAVE TRACE_SEARCH USER_SIGNALS
6.2.19 6.2.20 6.2.21
TV TS US
190
6.2.1
ANALYSIS (AN)
[Command syntax and parameters] * Display
Parameter
an []
Type Keyword Description Displays the result that it has measured the rate of time spent during the last program run. Default: Displays the rate of time spent during the last program run as percentages and histogram. v: Displays the rate of time spent during the last program run as percentages, amount of time spent and the execution count.
[Description] Displays the result that it has measured of the rate of time spent during the last program run. [Examples] 1. To display the result as percentages, amount of time spent and the execution count:
an v
2. To display the result as percentages and histogram:
an
191
6.2.2
ANALYSIS RANGEn (ARn)
Sets the conditions of the rate of time spent during the last program run, the address detection mode and the shortest measure clock. There are five measurement methods. * * * * * The Time Of Specified Range Measurement The Start Point To End Point Measurement The Start Range To End Range Measurement The Access Count Of Specified Range Measurement The Called Count Of Specified Range Measurement
It is possible to set the condition on all points by The Time Of Specified Range Measurement / The Start Point To End Point Measurement. The condition on 1, 3, 5, 7 point can be set by the other methods. The command syntax and parameters of each condition of the rate of time spent are listed below. (1) The Time Of Specified Range Measurement [Command syntax and parameters] * Setting
Parameter
ARn Range
Type Numeric Keyword Keyword Numeric Numeric Description Sets a channel number from 1 to 8. Makes settings for measurement of time in the specified range. Specifies the name of the range. Specifies a start address. Specifies an end address.
n
Range
[Description] This command measures time in the specified range. [Example] To set a condition of the rate of time spent in the specified range from the address H'100 to H'200: ar1 Range RAM H'100 H'200
192
(2) The Start Point To End Point Measurement [Command syntax and parameters] * Setting ARn PtoP [action ] [time


▲Up To Search▲   

 
Price & Availability of E702360SH7058

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X